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 d5cddd4 commit 9b99530Copy full SHA for 9b99530
1 file changed
lib/utils/hashdb.py
@@ -22,6 +22,7 @@ def __init__(self, filepath):
22
self.filepath = filepath
23
self._write_cache = {}
24
self._cache_lock = threading.Lock()
25
+ self._in_transaction = False
26
27
def _get_cursor(self):
28
threadData = getCurrentThreadData()
@@ -108,7 +109,11 @@ def flush(self, forced=False):
108
109
self.endTransaction()
110
111
def beginTransaction(self):
- self.cursor.execute('BEGIN TRANSACTION')
112
+ if not self._in_transaction:
113
+ self.cursor.execute('BEGIN TRANSACTION')
114
+ self._in_transaction = True
115
116
def endTransaction(self):
- self.cursor.execute('END TRANSACTION')
117
+ if self._in_transaction:
118
+ self.cursor.execute('END TRANSACTION')
119
0 commit comments