Re: MySql.Data.MySqlClient is so SLOW?
Posted by: Reggie Burnett
Date: November 29, 2005 08:56AM

Ben & Dennis

What you are seeing is dangerous behavior from CoreLab. In the latest Connector/net I have added connection string options to disable the checks that are performed on each connection open. This speeds up the opens dramatically however this can be very dangerous. For example, if you have 20 connections in your connection pool and you open one. Without using these connection string options to disable, this connection will be "reset" and the server "pinged". The ping is just to make sure the server is still there. The dangerous part is the "reset". If you don't reset the connection, then temp tables, user variables, and other items could be left over from the previous session. If you execute code that somehow interacts with these temp tables or user variables you can get odd behavior that is very hard to debug. The reset clears these out and makes sure the connection is just as if it had just been opened. Also, configuratoin items can change on the server (like max_packet_size) and without this reset you wouldn't pick up these config changes.

Check the docs with 1.0.7 for the connection string optoins for disabling these checks. Also, for the next version of the connector we are looking at using a thread in the pooling code to reset the connectiosn as they are checked in so the main thread will not be held up waiting for this reset.

Hope this helps,
Reggie

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.