wood burning stoves 2.0*
The moose likes Groovy and the fly likes Grails: save() works, update and delete() do not work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Languages » Groovy
Bookmark "Grails: save() works, update and delete() do not work" Watch "Grails: save() works, update and delete() do not work" New topic
Author

Grails: save() works, update and delete() do not work

Kai Wähner
Ranch Hand

Joined: Sep 16, 2009
Posts: 76
Hi there,

I have the following simple integration test:



Mitarbeiter is also simple:



The test passed without any errors. Saving some instances works, but I cannot update or delete them.

What's wrong with this code or what else could be the problem? (btw: I use the current Netbeans with Grails support as IDE).


Best regards, Kai


My IT-blog about my experiences with: Java / JEE, IT Conferences and IT Certifications

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Try calling save(flush:true) instead of just save()


GenRocket - Experts at Building Test Data
Kai Wähner
Ranch Hand

Joined: Sep 16, 2009
Posts: 76
Although I am aware of the "flush"-concept in JPA, I did not find anything about it in my grails book and tutorials. Works now. Thank you...
 
jQuery in Action, 2nd edition
 
subject: Grails: save() works, update and delete() do not work
 
Similar Threads
HashMap
Objects as Map keys without Hashcode and equals.
multiple synchronized block in class..
Stupid doubt about Grails ORM
testing String as immutable