@@ -161,7 +161,7 @@ def __init__(self, host, service='SQL2', options=None, **kwargs):
161
161
super (EncodedSession , self ).__init__ (host , service = service ,
162
162
options = options , ** kwargs )
163
163
164
- def open_database (self , db_name , password , parameters ): # pylint: disable=too-many-branches
164
+ def open_database (self , db_name , password , parameters ): # pylint: disable=too-many-branches,too-many-statements
165
165
# type: (str, str, Dict[str, str]) -> None
166
166
"""Perform a handshake as a SQL client with a NuoDB TE.
167
167
@@ -228,12 +228,12 @@ def open_database(self, db_name, password, parameters): # pylint: disable=too-m
228
228
self .__connectedNodeID = self .getInt ()
229
229
self .__maxNodes = self .getInt ()
230
230
231
- uuid = str (self .db_uuid )
231
+ dbid = str (self .db_uuid )
232
232
with EncodedSession .__dblock :
233
233
if EncodedSession .__databases is None :
234
234
EncodedSession .__databases = {}
235
- if uuid not in EncodedSession .__databases :
236
- EncodedSession .__databases [uuid ] = EncodedSession .DbInfo (self .__maxNodes )
235
+ if dbid not in EncodedSession .__databases :
236
+ EncodedSession .__databases [dbid ] = EncodedSession .DbInfo (self .__maxNodes )
237
237
238
238
self .__sessionVersion = protocolVersion
239
239
@@ -285,7 +285,10 @@ def send_close(self):
285
285
def __set_dbinfo (self , sid , txid , seqid ):
286
286
# type: (int, int, int) -> None
287
287
with EncodedSession .__dblock :
288
- EncodedSession .__databases [str (self .db_uuid )].info [sid ] = (txid , seqid )
288
+ info = EncodedSession .__databases [str (self .db_uuid )].info
289
+ lci = info .get (sid , (- 1 , - 1 ))
290
+ if seqid > lci [1 ]:
291
+ info [sid ] = (txid , seqid )
289
292
290
293
def send_commit (self ):
291
294
# type: () -> int
0 commit comments