Skip to content

Instantly share code, notes, and snippets.

@marcpalmer
Created November 12, 2012 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcpalmer/4058957 to your computer and use it in GitHub Desktop.
Save marcpalmer/4058957 to your computer and use it in GitHub Desktop.
Hibernate optimist locking code snippet #15
def update = {
withUpdateTransaction {
def photo = Photo.get(params.id) // actually does lock(id)
photo.properties = params
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment