generated from root/miduo_server
uid自增增加锁
parent
a02f9b950f
commit
2407b4186c
|
@ -84,7 +84,7 @@ public class MyMongoDBPool {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int inc(String collectionName, String id, String key) {
|
public synchronized int inc(String collectionName, String id, String key) {
|
||||||
DBCollection collection = db.getCollection(collectionName);
|
DBCollection collection = db.getCollection(collectionName);
|
||||||
BasicDBObject searchQuery = new BasicDBObject();
|
BasicDBObject searchQuery = new BasicDBObject();
|
||||||
searchQuery.put("_id", id);
|
searchQuery.put("_id", id);
|
||||||
|
|
Loading…
Reference in New Issue