Two Laptop Bag*
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
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...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Grails: save() works, update and delete() do not work