Created
November 12, 2012 11:51
-
-
Save marcpalmer/4058935 to your computer and use it in GitHub Desktop.
Hibernate optimist locking code snippet #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Transactional service method | |
void addComment(Photo photo, String text) { | |
def comment = new PhotoComment(text: text) | |
comment.save() | |
photo.addToComments(comment) | |
} | |
// Asynchronous Quartz Job method | |
void uploadPhoto(Photo p) { | |
// do something with S3 | |
// … | |
photo.url = newUrl | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment