Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 404
greymatter Avatar asked Feb 17 '14 01:02

greymatter


1 Answers

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.

like image 82
Igor Avatar answered Dec 06 '22 06:12

Igor