Jun 9th, 2011, 12:27 AM
How to tell if a MongoTemplate operation fails
I'm new to Spring Data and MongoDB, but I noticed that none of the MongoTemplate's methods give you any indication that an operation failed. For instance, I'm trying to update a document, and in my application, it looked like everything looked fine because mongoTemplate.save(obj) just returned like it worked. Come to find out when I looked in the mongo logs, it is failing because of an indexing exception. Is there anyway to tell if a query, insert, update, etc just plain failed?
Tags for this Thread