File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 109109from lib .core .settings import UNION_CHAR_REGEX
110110from lib .core .settings import UNKNOWN_DBMS_VERSION
111111from lib .core .settings import WEBSCARAB_SPLITTER
112+ from lib .core .threads import getCurrentThreadData
112113from lib .core .update import update
113114from lib .parse .configfile import configFileParser
114115from lib .parse .payloads import loadPayloads
@@ -1331,6 +1332,9 @@ class _(unicode): pass
13311332 if conf .code :
13321333 conf .code = int (conf .code )
13331334
1335+ threadData = getCurrentThreadData ()
1336+ threadData .reset ()
1337+
13341338def __setConfAttributes ():
13351339 """
13361340 This function set some needed attributes into the configuration
Original file line number Diff line number Diff line change @@ -33,10 +33,16 @@ class _ThreadData(threading.local):
3333 """
3434
3535 def __init__ (self ):
36- global shared
36+ self .reset ()
37+
38+ def reset (self ):
39+ """
40+ Resets thread data model
41+ """
3742
3843 self .disableStdOut = False
3944 self .hashDBCursor = None
45+ self .inTransaction = False
4046 self .lastErrorPage = None
4147 self .lastHTTPError = None
4248 self .lastRedirectMsg = None
Original file line number Diff line number Diff line change @@ -22,7 +22,6 @@ def __init__(self, filepath):
2222 self .filepath = filepath
2323 self ._write_cache = {}
2424 self ._cache_lock = threading .Lock ()
25- self ._in_transaction = False
2625
2726 def _get_cursor (self ):
2827 threadData = getCurrentThreadData ()
@@ -109,11 +108,13 @@ def flush(self, forced=False):
109108 self .endTransaction ()
110109
111110 def beginTransaction (self ):
112- if not self ._in_transaction :
111+ threadData = getCurrentThreadData ()
112+ if not threadData .inTransaction :
113113 self .cursor .execute ('BEGIN TRANSACTION' )
114- self . _in_transaction = True
114+ threadData . inTransaction = True
115115
116116 def endTransaction (self ):
117- if self ._in_transaction :
117+ threadData = getCurrentThreadData ()
118+ if threadData .inTransaction :
118119 self .cursor .execute ('END TRANSACTION' )
119- self . _in_transaction = False
120+ threadData . inTransaction = False
You can’t perform that action at this time.
0 commit comments