parent
3deebad503
commit
297918f719
|
@ -175,12 +175,23 @@ public class MongoSessionIdManager extends AbstractSessionIdManager
|
||||||
_server = server;
|
_server = server;
|
||||||
_sessions = sessions;
|
_sessions = sessions;
|
||||||
|
|
||||||
_sessions.ensureIndex(
|
DBObject idKey = BasicDBObjectBuilder.start().add("id", 1).get();
|
||||||
BasicDBObjectBuilder.start().add("id",1).get(),
|
_sessions.createIndex(idKey,
|
||||||
BasicDBObjectBuilder.start().add("unique",true).add("sparse",false).get());
|
BasicDBObjectBuilder.start()
|
||||||
_sessions.ensureIndex(
|
.add("name", "id_1")
|
||||||
BasicDBObjectBuilder.start().add("id",1).add("version",1).get(),
|
.add("ns", _sessions.getFullName())
|
||||||
BasicDBObjectBuilder.start().add("unique",true).add("sparse",false).get());
|
.add("sparse", false)
|
||||||
|
.add("unique", true)
|
||||||
|
.get());
|
||||||
|
|
||||||
|
DBObject versionKey = BasicDBObjectBuilder.start().add("id", 1).add("version", 1).get();
|
||||||
|
_sessions.createIndex(versionKey, BasicDBObjectBuilder.start()
|
||||||
|
.add("name", "id_1_version_1")
|
||||||
|
.add("ns", _sessions.getFullName())
|
||||||
|
.add("sparse", false)
|
||||||
|
.add("unique", true)
|
||||||
|
.get());
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue