Page 1 of 1

how to test connection pooling?

Posted: Fri 15 Jul 2005 22:50
by shutterstock
I started to use pooling--

how do i make sure that the connection doesn't keep getting recreated and that a pooled connection is used (if available)...

is there any way to tell that im reusing existing connections - and not really creating new opened ones?

thanks
Jon

Posted: Mon 18 Jul 2005 09:43
by Oleg
You can test the connection pool as follows.

Code: Select all

connection.Open(); // connection to server is established
...
connection.Close(); // connection is moved to pool (you can verify it with MySQLAdmin tool)
...
connection.Open(); // connection is taken from pool; new one is not created
...
connection.Close(); // again, connection is returned to pool.