In Python, the normal use of the database, you can call connection in the Autocommit function to set whether to turn on Automatic Updates
self._db = MySQLdb.connect (**self._db_args) self._db.autocommit (True)
However, if the thread pool pooleddb is used, it cannot be set using the connection returned by the thread pool, but is set when the thread pool is created
Self.__pool = Pooleddb (Creator=mysqldb, mincached=1, maxcached=20, Host=dbhost, Port=dbport, User=DBUSER, Passwd=DBPWD , db=dbname,use_unicode=false,charset=dbchar,cursorclass=dictcursor,setsession=[' SET AUTOCOMMIT = 1 '])
One of the
setsession=[' SET autocommit = 1 ']
is used to set whether the thread pool turns on automatic update configuration, 0 is false,1 true
This article is from the "Shadow of the Moon, shadow of the Sea" blog, please be sure to keep this source http://abyss.blog.51cto.com/3625755/1736844
On the method of POOLEDDB using autocommit