Repeated logins on single connection
Posted: Wed 06 Sep 2006 14:54
Hi,
I'm working on something of a legacy application, where we recently switched to MySQL (with MyDAC 4.30) as the backend. When testing the app at the client's site, we discovered an issue where on a long batch of operations the connection would seem to die.
Since we didn't have a dev environment there, I used the next best thing -- I fired up Wireshark (formerly Ethereal) to snoop on the connection, to see what's going on. To my great surprise I noticed that the application logs in to the database literally hundreds or even thousands of times, all the while using a single MyConnection instance. Please note that we have never seen more than one concurrent connection at the server's side (although it is still possible).
I've tried to narrow the issue down to a minimal test case with no luck -- the application is pretty tangled, so extracting a single problematic bit is nigh impossible. However, as an example, when the application starts, it opens up three tables and/or SQL queries which results in three logins to the db. Opening three tables in a blank test project does no such thing, so I'm guessing whatever causes it happens in an event handler somewhere.
For the record: I've tried using both Direct access and the MySQL client library, and both with and without connection pooling, with no change to the behaviour. Also, I've reproduced the issue with MyDAC 4.40.
Now, I'd like to ask if you know of any situation when the MyDAC components would re-login using the same connection, or possibly spawn new connections altogether?
I'm working on something of a legacy application, where we recently switched to MySQL (with MyDAC 4.30) as the backend. When testing the app at the client's site, we discovered an issue where on a long batch of operations the connection would seem to die.
Since we didn't have a dev environment there, I used the next best thing -- I fired up Wireshark (formerly Ethereal) to snoop on the connection, to see what's going on. To my great surprise I noticed that the application logs in to the database literally hundreds or even thousands of times, all the while using a single MyConnection instance. Please note that we have never seen more than one concurrent connection at the server's side (although it is still possible).
I've tried to narrow the issue down to a minimal test case with no luck -- the application is pretty tangled, so extracting a single problematic bit is nigh impossible. However, as an example, when the application starts, it opens up three tables and/or SQL queries which results in three logins to the db. Opening three tables in a blank test project does no such thing, so I'm guessing whatever causes it happens in an event handler somewhere.
For the record: I've tried using both Direct access and the MySQL client library, and both with and without connection pooling, with no change to the behaviour. Also, I've reproduced the issue with MyDAC 4.40.
Now, I'd like to ask if you know of any situation when the MyDAC components would re-login using the same connection, or possibly spawn new connections altogether?