Fix autocommit mode in oursql.
--- a/pydbkit/mymanager_oursql.py Wed Jul 09 18:04:11 2014 +0200
+++ b/pydbkit/mymanager_oursql.py Fri Jul 25 15:15:16 2014 +0200
@@ -289,7 +289,10 @@
conn = oursql.connect(default_cursor=Cursor, **ci.parameters)
if not ci.isolation_level is None:
if ci.isolation_level == 'AUTOCOMMIT':
- conn.autocommit(True)
+ # This is default in MySQL, but to be sure...
+ curs = conn.cursor()
+ curs.execute('SET autocommit = 1;')
+ curs.close()
else:
curs = conn.cursor()
curs.execute('SET SESSION TRANSACTION ISOLATION LEVEL ' + ci.isolation_level)