Skip to content

Commit

Permalink
ATS-23
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Müller authored and Matthias Müller committed Apr 3, 2020
1 parent 31d15d5 commit 395c318
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/org/appng/tomcat/session/mongo/MongoStore.java
Expand Up @@ -315,9 +315,10 @@ public StandardSession load(String id) throws ClassNotFoundException, IOExceptio
long start = System.currentTimeMillis();
DBObject mongoSession = getMongoSession(id);

String currentThread = Thread.currentThread().getName();
if (null == mongoSession) {
info("Session %s not found for thread %s (active session is %s), returning null!", id,
Thread.currentThread().getName(), currentSessionId.get());
info("Session %s not found for thread %s (active session is %s), returning null!", id, currentThread,
currentSessionId.get());
} else {
Container container = manager.getContext();
Context context = (Context) container;
Expand All @@ -332,7 +333,7 @@ public StandardSession load(String id) throws ClassNotFoundException, IOExceptio
session.readObjectData(ois);
session.setManager(this.manager);

if (!(sticky || threadName.startsWith(TOMCAT_SESSION_THREAD))) {
if (!(sticky || currentThread.startsWith(TOMCAT_SESSION_THREAD))) {
BasicDBObject setHost = new BasicDBObject("$set", new BasicDBObject(HOST_PROPERTY,
String.format("%s@%s", Thread.currentThread().getName(), hostName)));
this.collection.update(sessionQuery, setHost);
Expand Down

0 comments on commit 395c318

Please sign in to comment.