Hi
So i discovered that it might be a good idea use read() on your update method.
So use
def person = Person.read(params.id)
instead of
def person = Person.get(params.id)
The consequence of this is that hibernate dirty checking is turned off. So to save your domain object you MUST call save(). So if you cancel the update for any reason without calling save() you do not have to to worry about grails persisting things automatically due to dirty checking :)
Hope this helps
2 comments:
Just figured this one myself, your blog posts confirms I can do it ;-) thanks
Any way to do a similar thing with dynamic finders (findAll, etc)?
Post a Comment