Pessimistic locking in Jmix

I wonder how we can use pessimistic locking in Jmix. I stumbled upon LockManager and @PessimisticLock, but not enough documentation, so I’m not sure how to actually use it.

I set my entity to use @PessimisticLock annotation already. And somehow whenever I try to lock an Entity, the method returns LockInfo, which indicate that it’s already locked by someone. Is this because I also open the Entity in the Edit screen? Is there any guide on this?

Thank you!

Hello!

StandardEditor by default tries to lock entity instance if it has @PessimisticLock annotation.

Also, there is no default task that checks expiration timeout. So you need to write some scheduler or manually unlock the instance.

Unfortunately, there is no guide how to work with it. I’ve created an issue to describe it in the documentaion: jmix-framework/jmix-docs#387.