10bet网址
MySQL Connector/Python Developer Guide
Related Documentation Download this Manual
PDF (US Ltr)- 0.6Mb
PDF (A4)- 0.6Mb


10.4 pooling.PooledMySQLConnection Class

This class is used byMySQLConnectionPool返回一个合用的连接实例。这也是the class used for connections obtained with calls to theconnect()method that name a connection pool (seeSection 9.1, “Connector/Python Connection Pooling”).

PooledMySQLConnectionpooled connection objects are similar toMySQLConnectionunpooled connection objects, with these differences:

  • To release a pooled connection obtained from a connection pool, invoke itsclose()method, just as for any unpooled connection. However, for a pooled connection,close()does not actually close the connection but returns it to the pool and makes it available for subsequent connection requests.

  • A pooled connection cannot be reconfigured using itsconfig()method. Connection changes must be done through the pool object itself, as described bySection 9.1, “Connector/Python Connection Pooling”.

  • A pooled connection has apool_nameproperty that returns the pool name.