Re: Connection pooling not working
Posted by: Fernando Gonzalez Sanchez
Date: August 13, 2014 04:40PM

Hi, MySqlHelper is just a convenience to avoid having to write more code (but internally does the same, creates a command & connection and executes the query).
So is basically the same performance, but...

Inside a loop You may get better performance with the overload
public static int ExecuteNonQuery(MySqlConnection connection, string commandText, params MySqlParameter[] commandParameters)

than with
public static int ExecuteNonQuery(string connectionString, string commandText, params MySqlParameter[] parms)

The difference is that the 2nd creates a new connection of the passed connection string every time.

And there is an overhead of executing new MySqlConnection vs using the same instance 100s times (even if Pooling is enabled).

You can check pooling is actually working by running "show processlist" in the server, during application execution. You will see a bunch of idle connections (those are part of the pool created).

The ConnectionString settings that govern how much connections are in the pool are MaximumPoolSize and MinimumPoolSize.

*** My opinions do not necessarily reflect the opinions of my employeer ***
Fernando Gonzalez Sanchez
Sr. Software Engineer
MySql Connector/NET Team
Oracle Corporation

Options: ReplyQuote


Subject
Written By
Posted
Re: Connection pooling not working
August 13, 2014 04:40PM


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.