What does "pooling = false" mean in the MySQL connection string?

What does pooling=false mean in a .NET connection for a MySQL database?

This is the full connection string:

 return new MySqlConnection("SERVER=localhost;DATABASE=myDataBase;USER=###;PASSWORD=***;POOLING=FALSE;"); 
+6
source share
2 answers

When pooling=false connection will not be returned to the pool when SqlConnection.Close() called

From MSDN

When the value of this key is set to true, all newly created connections will be added to the pool when the application is closed. In the next attempt to open the same connection, this connection will be from the pool. Connections are considered the same if they have the same connection string. Different connections have different connection string

+4
source

Will the connection be part of the connection pool or not? This means that the connection will be used throughout the application instead of creating a new one each time it is opened.

Please note that for a connection pool to work, the connection string must be EXACTLY the same, that is, you cannot change the character in the string (even spaces) and work with the pool. Thus, the connection is created:

 "SERVER=localhost;DATABASE=myDataBase;USER=###;PASSWORD=***;POOLING=FALSE;" 

will not be used in conjunction with the creation of:

 " SERVER=localhost;DATABASE=myDataBase;USER=###;PASSWORD=***;POOLING=FALSE;" 

because of the leading space.

+5
source

Source: https://habr.com/ru/post/952112/


All Articles