Remove synchronization around session iteration when checking for idle sessions.
This commit is contained in:
Jan Bartel 2016-04-29 10:22:09 +10:00
parent c74dd571fa
commit 480aa4d874
1 changed files with 6 additions and 8 deletions

View File

@ -602,16 +602,14 @@ public class MongoSessionManager extends NoSqlSessionManager
long idleMs = getIdlePeriod()*1000L;
long now = System.currentTimeMillis();
synchronized (this) //necessary?
for (NoSqlSession session:_sessions.values())
{
for (NoSqlSession session:_sessions.values())
if (session.getAccessed()+ idleMs < now)
{
if (session.getAccessed()+ idleMs < now)
{
//idle the session by passivating the session to mongo, then clearing the session's attribute map in memory
session.idle();
}
//idle the session by passivating the session to mongo, then clearing the session's attribute map in memory
session.idle();
}
}
}