withPessimisticLock
Purpose
withPessimisticLock
method provides an easy way to use a pessimistic lock.Examples
SampleDomain.withPessimisticLock(id) { Object lockedDomain -> // Operations to require a pessimistic lock}.onNotFound { -> // Operations when the target is not found
}