C# - Why Is .net UIAutomation App Leaking / Pooling
Jun 29, 2010
I've got an app using .net UIAutomation, it eventually runs out of memory and crashes just monitoring windows being shown and closed. Seemed easier to show this in VB than C# but happens the same either way. It appears to be a leak/pool in the underlying proxy objects. Most of the memory is not being shown as in use as .net memory.
[Code]...
View 1 Replies
Jan 9, 2012
I am working on completely redeveloped website and sales system and have come up against this Max_connections issue surprisingly quickly.Closing/Pooling MySQL ODBC connections Recently, but have since tried a few other things, still drawing a blank, but have more detail to offer...I have a built a pretty complex sales process, and in creating an invoice I seem to be leaving 7 "processes" running each time. I have counted the number of times the data connection is used during the process of creating an invoice, and it is 7-9 depending on a few conditional values, so effectively the data connections are not closing at all.To try to speed up coding, I have made a couple of functions which handle my database connectivity, so I will post these below.
Firstly, my connection string is:
"DRIVER={MySQL ODBC 3.51 Driver}; SERVER=mysql.dc-servers.com; DATABASE=jamieha_admin; UID=USERID; PASSWORD=pWD; OPTION=3;pooled=true;Max Pool Size=100"
The functions which I am using to open and close and do stuff with the database are as follows:
Function connectionString(sql As String, closeConnection As String) As OdbcConnection
Dim DBConnection As String = ConfigurationManager.ConnectionStrings("dbConnNew").ConnectionString
'this is getting the connection string from web.config file.
[code]....
I am not sure whether making all these functions is making my life easier or harder, but I was trying to reduce the code in each file where data acceess is required, but I'm not convinced it has.However, it has made it clear where and when I am opening and closing the database (or at least trying to)The processes are not being closed though. If I run my sale process through 3 or 4 times in quick succession, with these 7 processes still being live and added to, I get the max_connections issue.
a) Is my connection string correct, is there a better connection available for MySQL?
b) Using this method, creating a ODBCConnection Object, is it possible to close it within a function like this?
c) Why is (CommandBehavior.CloseConnection) not closing the connection (this problem arose before I tried closing the connection manually)
View 1 Replies
May 19, 2010
My application requires a user to log in and allows them to edit a list of things. However, it seems that if the same user always logs in and out and edits the list, this user will run into a "System.Data.SqlClient.SqlException: Timeout expired." error. I've read a comment about it possibly caused by uncommitted transactions. And I do have one going in the application.
[Code]...
View 4 Replies
May 19, 2012
What does "inactivity" means related to SQL Server Connection Pooling (ADO.NET) Is it decided based on time ?If yes, then how to get the limit? and what happenes when the inactivity limit reached?
View 3 Replies
Jul 21, 2010
I am working on uses the ThreadPool class and specifically the QueueUserWorkItem method to launch its background tasks. I am however having an issue related to SqlConnection timeouts. My error is this: "Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached."
This code is using all available ThreadPool threads because it is processing nearly 100,000 items, each on a threadpool thread, and updating an SQL database. So my question is this? Has anyone ran into a similar problem or could shed some light on a resolution to this issue? In testing, if I use the threadpool. setmaxthreads function and give it a value of 100 (to match the default Sql connection pooling count) then all runs just fine, but much to slow to process this much data.
[Code]
View 5 Replies