I have an older technology project that uses PrimeFaces 3.5 and Java EE. I am trying to implement a locking mechanism to prevent multiple users from editing the same entity simultaneously.
For example, when a user enters the edit page for a specific entity, I want to ensure that no other user can access the same entity for editing.
I have implemented the locking mechanism in the init() method of the page. However, I am unsure how to unlock the entity when a user leaves the page, when their session ends, or if they close their browser.
Any suggestions or best practices for managing this scenario?
Thank you.
3