如果您调用lock()
在域实例上或静态在类上,然后您决定对对象无事可做,有没有办法手动立即释放锁?
最佳答案
扩展什么dmahapatro说,docs表明:
The lock is automatically released when the transaction commits
因此,一旦您调用
.save()
,当该保存的事务提交时(通常在服务结束方法时),锁将被释放。您可能还想查看这些 docs .
关于grails - 调用 lock() 后如何解锁域对象?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21819150/