[JAVA-62] Server-side user exception for a multi update is swallowed by Java Driver Created: 14/Dec/09  Updated: 13/Jan/10  Resolved: 14/Dec/09

Status: Closed
Project: Java Driver
Component/s: None
Affects Version/s: 1.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Niko Schmuck Assignee: Eliot Horowitz (Inactive)
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mac OS 10.6.2, Java 1.6, Mongo Server 1.2.0



 Description   

I upgraded my MongoDB server from 1.1.0 to 1.2.0
and suddenly the update operation:

dbColl.update(query, (DBObject) entry, true, true);

is not any longer working:

Mon Dec 14 20:44:57 User Exception multi update only works with $ operators
Mon Dec 14 20:44:57 s7meta_gemini.medix999 Caught Assertion update, continuing
Mon Dec 14 20:44:57 update s7meta_gemini.medix999 query:

{ asset_id: 4711 }

exception userassert:multi update only works with $ operators 4ms

What really surprised me that there is no exception thrown on the Java driver level, this signals that the update was run successfully although not saved to the MongoDB. Thanks to the server log file, it turns out that I had to change the fourth parameter (multi from true to false) then the update is working fine again, I still think that a server exception should be spread to the driver level.



 Comments   
Comment by Eliot Horowitz (Inactive) [ 14/Dec/09 ]

by default, all write operations are fire and forget.
if you want errors thrown, you need to run
DBCollection.setWriteConcern( DB.WriteConcern.STRICT )

Generated at Thu Feb 08 08:51:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.