Pessimistic locking in Grails

We already know that by default Grails scaffold comes with Optimistic locking and it is achieved by version field. Now lets see how Pessimistic locking is achieved in Grails. Grails has a built in method to acquire lock on object. To acquire a lock we will do something like following [java] Book book = Book.get(1) book.lock() ...

by Uday Pratap Singh
Tag: locking in grails