Page 1 of 1

Monitor of Connection Pool

Posted: Thu 05 May 2005 09:33
by joannelai
I am writing a Windows Form application in which it would select or modify data from the database using a single connection. I enabled the pooling option and and set the max pool size to 10.

In order to avoid orphaned connections and overflows, I would like to write code to monitor the number of connections in pool of a specificed user. However, I have no idea what to do 'coz the .NET CLR Data (Performance Monitor) doesn't work for MySQL.

Any help is appreciated.

Best Rgds,
Joanne

Posted: Thu 05 May 2005 10:09
by Serious
Connection pool searches for broken connections without assistance, so you don't need to do it manually.
Moreover, it is strange that you try to detect pool overflov in case that your application uses single connection, this check seems to be redundant in your case.

Posted: Thu 05 May 2005 14:02
by joannelai
What I mean "single connection" is a static connection used by the whole application. I tried to to use the said connection while it is executing a query, but the application freezes until the first query is being finished. I am confused with how the connection pool works. How can the pool improve the performance of application in dealing with differnt queries simultaneously?

Best Rgds,
Joanne

Posted: Thu 05 May 2005 14:17
by Serious
Use separate connection for each query.

Posted: Fri 06 May 2005 00:38
by Guest
Then how the connection pool works under this situation?

Posted: Fri 06 May 2005 07:22
by Serious
Under your situation (static connection used by the whole application) connection pooling works only if you often close and open the connection.

You can find additional information about connection pooling here (note that MySQLDirect .NET uses the same connection poooling concept as the .NET Framework Data Provider for Oracle).