This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 15286
    
    6

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


GenRocket - A Test Data Generation Platform
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
 
Similar Threads
Objects as Map keys without Hashcode and equals.
multiple synchronized block in class..
testing String as immutable
HashMap
Stupid doubt about Grails ORM