Ensure autocommit is always activated.
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 16 Jan 2011 15:58:52 +0000 (16:58 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sun, 16 Jan 2011 15:58:52 +0000 (16:58 +0100)
This should have two major consequences:
* the rpc should have a view of the db consistent with the view of the
website
* this should reduce the overall memory footprint of the mysql database
since there is no "in progress transaction" and thus no need to keep old
data in the db.

Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
bin/lists.rpc.py

index 557b4c1..5f7e921 100755 (executable)
@@ -167,6 +167,7 @@ def connectDB():
             passwd=MYSQL_PASS,
             unix_socket='/var/run/mysqld/mysqld.sock')
     db.ping()
+    db.autocommit(True)
     return db.cursor()
 
 def mysql_fetchone(query):