Created
May 17, 2011 15:04
-
-
Save emedina/976641 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
groovy> import es.coftal.dominio.* | |
groovy> def u = new Usuario(login:'emedina1', password:'sldkslkdlks') | |
groovy> try { | |
groovy> Usuario.withSession { session -> | |
groovy> session.writeConcern = com.mongodb.WriteConcern.SAFE | |
groovy> try { | |
groovy> u.save(flush:true, failOnError:true) | |
groovy> } | |
groovy> catch (e) { | |
groovy> println "CAUGHT EXCEPTION!!!!!! = " + e | |
groovy> } | |
groovy> } | |
groovy> } | |
groovy> catch (e) { | |
groovy> println "CAUGHT EXCEPTION IN TX!!!!!!! = " + e | |
groovy> } | |
CAUGHT EXCEPTION!!!!!! = org.springframework.dao.DataIntegrityViolationException: E11000 duplicate key error index: cOftal.usuario.$login_1 dup key: { : "emedina1" }; nested exception is com.mongodb.MongoException$DuplicateKey: E11000 duplicate key error index: cOftal.usuario.$login_1 dup key: { : "emedina1" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment