Skip to content

Commit d726050

Browse files
committed
Patch for an Issue sqlmapproject#991
1 parent 034fae0 commit d726050

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

lib/utils/hashdb.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,15 @@ def flush(self, forced=False):
139139
def beginTransaction(self):
140140
threadData = getCurrentThreadData()
141141
if not threadData.inTransaction:
142-
self.cursor.execute("BEGIN TRANSACTION")
143-
threadData.inTransaction = True
142+
try:
143+
self.cursor.execute("BEGIN TRANSACTION")
144+
except:
145+
# Reference: http://stackoverflow.com/a/25245731
146+
self.cursor.close()
147+
threadData.hashDBCursor = None
148+
self.cursor.execute("BEGIN TRANSACTION")
149+
finally:
150+
threadData.inTransaction = True
144151

145152
def endTransaction(self):
146153
threadData = getCurrentThreadData()

0 commit comments

Comments
 (0)