[Bug 410630] MongoSessionManager conflicting session update op

This commit is contained in:
Jesse McConnell 2013-06-12 16:43:14 -05:00
parent 52994f336a
commit f9e6cb932c
1 changed files with 16 additions and 16 deletions

View File

@ -131,25 +131,25 @@ public class MongoSessionManager extends NoSqlSessionManager
BasicDBObject sets = new BasicDBObject();
BasicDBObject unsets = new BasicDBObject();
// handle new or existing
if (version == null)
{
// New session
upsert = true;
version = new Long(1);
sets.put(__CREATED,session.getCreationTime());
sets.put(__VALID,true);
sets.put(getContextKey(__VERSION),version);
}
else
{
version = new Long(((Number)version).longValue() + 1);
update.put("$inc",__version_1);
}
// handle valid or invalid
if (session.isValid())
{
// handle new or existing
if (version == null)
{
// New session
upsert = true;
version = new Long(1);
sets.put(__CREATED,session.getCreationTime());
sets.put(__VALID,true);
sets.put(getContextKey(__VERSION),version);
}
else
{
version = new Long(((Number)version).longValue() + 1);
update.put("$inc",__version_1);
}
sets.put(__ACCESSED,session.getAccessed());
Set<String> names = session.takeDirty();
if (isSaveAllAttributes() || upsert)