Skip to content

Commit 522e542

Browse files
committed
Updates for PR
1 parent edf3ca5 commit 522e542

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

pynuodb/encodedsession.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def __init__(self, host, service='SQL2', options=None, **kwargs):
161161
super(EncodedSession, self).__init__(host, service=service,
162162
options=options, **kwargs)
163163

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
165165
# type: (str, str, Dict[str, str]) -> None
166166
"""Perform a handshake as a SQL client with a NuoDB TE.
167167
@@ -228,12 +228,12 @@ def open_database(self, db_name, password, parameters): # pylint: disable=too-m
228228
self.__connectedNodeID = self.getInt()
229229
self.__maxNodes = self.getInt()
230230

231-
uuid = str(self.db_uuid)
231+
dbid = str(self.db_uuid)
232232
with EncodedSession.__dblock:
233233
if EncodedSession.__databases is None:
234234
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)
237237

238238
self.__sessionVersion = protocolVersion
239239

@@ -285,7 +285,10 @@ def send_close(self):
285285
def __set_dbinfo(self, sid, txid, seqid):
286286
# type: (int, int, int) -> None
287287
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)
289292

290293
def send_commit(self):
291294
# type: () -> int

0 commit comments

Comments
 (0)