Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 034fae0 commit d726050Copy full SHA for d726050
1 file changed
lib/utils/hashdb.py
@@ -139,8 +139,15 @@ def flush(self, forced=False):
139
def beginTransaction(self):
140
threadData = getCurrentThreadData()
141
if not threadData.inTransaction:
142
- self.cursor.execute("BEGIN TRANSACTION")
143
- threadData.inTransaction = True
+ try:
+ self.cursor.execute("BEGIN TRANSACTION")
144
+ except:
145
+ # Reference: http://stackoverflow.com/a/25245731
146
+ self.cursor.close()
147
+ threadData.hashDBCursor = None
148
149
+ finally:
150
+ threadData.inTransaction = True
151
152
def endTransaction(self):
153
0 commit comments