c# – MySQL连接字符串中的“pooling = false”是什么意思?

前端之家收集整理的这篇文章主要介绍了c# – MySQL连接字符串中的“pooling = false”是什么意思?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
MySQL数据库的.NET连接字符串中的pooling = false意味着什么?

这是完整的连接字符串:

return new MysqLConnection("SERVER=localhost;DATABASE=myDataBase;USER=###;PASSWORD=***;POOLING=FALSE;");

解决方法

当pooling = false时,当您调用sqlConnection.Close()时,连接将不会返回到池

MSDN

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

猜你在找的C#相关文章