Skip to content

Commit

Permalink
fix: minor fix for lookup of remote session from thread local
Browse files Browse the repository at this point in the history
  • Loading branch information
tglman committed Sep 18, 2023
1 parent 6d1df43 commit 7354684
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2066,9 +2066,9 @@ protected OStorageRemoteSession getCurrentSession() {
ODatabaseDocumentInternal db = null;
if (ODatabaseRecordThreadLocal.instance() != null)
db = ODatabaseRecordThreadLocal.instance().getIfDefined();
ODatabaseDocumentRemote remote =
(ODatabaseDocumentRemote) ODatabaseDocumentTxInternal.getInternal(db);
if (remote == null) return null;
ODatabaseDocumentInternal internal = ODatabaseDocumentTxInternal.getInternal(db);
if (internal == null || !(internal instanceof ODatabaseDocumentRemote)) return null;
ODatabaseDocumentRemote remote = (ODatabaseDocumentRemote) internal;
OStorageRemoteSession session = remote.getSessionMetadata();
if (session == null) {
session = new OStorageRemoteSession(sessionSerialId.decrementAndGet());
Expand Down

0 comments on commit 7354684

Please sign in to comment.