Skip to content
Snippets Groups Projects
Commit 3526f7f3 authored by Vermaat's avatar Vermaat
Browse files

Auto reconnect to MySQL server

git-svn-id: https://humgenprojects.lumc.nl/svn/mutalyzer/trunk@498 eb6bd6ab-9ccd-42b9-aceb-e2899b4a52f1
parent 451b671d
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,15 @@ from mutalyzer import util
from mutalyzer import config
# Automatically reconnect to the MySQL server. This is expecially useful for
# long-running processes such as the batch deamon, which would otherwise loose
# their connection on an event such as restarting the MySQL server. Also see
# Trac ticket #91.
# Be alarmed though, that this messes up transactions. Fortunately, Mutalyzer
# doesn't use transactions at the moment.
AUTO_RECONNECT = True
#
# Note that compound queries are split into single queries because of a bug
# in MySQLdb. The functions load_Update(), merge_cdsUpdates() and
......@@ -64,8 +73,8 @@ class Db() :
@type mySqlHost: string
"""
self.__db = MySQLdb.connect(user = mySqlUser, db = dbName,
host = mySqlHost)
self.__db = MySQLdb.connect(user=mySqlUser, db=dbName, host=mySqlHost,
reconnect=AUTO_RECONNECT)
#__init__
def query(self, statement) :
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment