Hi Alvin
Below is sample code giving error intermittently. The problem is seen
with Java Mongo Driver 2.2 and 2.3.
Note I am using db.requestStart and db.requestDone
//Connect to the database and collection
Mongo m = new Mongo();
DB db = m.getDB(“xyz”);
db.requestStart();
DBCollection coll = db.getCollection(“uuu”);
//Package the first part of the query
BasicDBObject query = new BasicDBObject();
query.put("user_id", userid);
BasicDBObject query1 = new BasicDBObject();
query1.put("abc", abc);
query1.put("def", def);
query1.put("ghi", ghi);
query.put("array", new BasicDBObject("$elemMatch",
query1));
//Package the second part of the query
BasicDBObject update = new BasicDBObject();
BasicDBObject update1 = new BasicDBObject();
update1.put("recent.$.abc", abc);
update1.put("recent.$.date", new
Date().getTime());
update1.put("recent.$.def", def);
update.put("$set", update1);
update.put("$inc", new BasicDBObject("recent.
$.count", 1));
//Execute the query
WriteResult r = coll.update(query, update); -->
(Exception is thrown here)
db.requestDone();
Thanks
Rajesh
On Nov 18, 4:58 pm, Alvin Richards <
al...@10gen.com> wrote:
> Rajesh,
>
> Could you paste your Java connection code.
>
> Thanks
>
> -Alvin
>