How do you unlock a domain object after calling lock()?

grails, grails-2.0, grails-orm

Solution

To expand on what dmahapatro said, the docs indicate:

The lock is automatically released when the transaction commits

so once you call `.save()`, the lock will be released when the transaction for that save commits (typically at end of service method).

You may also want to check out these docs.

Problem

If you call `lock()` on a domain instance or statically on the class, and then you decide there is nothing to do to the object, is there a way to manually and immediately release the lock?

Original source