jethro-pmm
jethro-pmm copied to clipboard
Use onunload event to release locks
if I open the form to edit some object in Jethro then I have the lock on that object until I save or click the "cancel" button. If I just close my browser, or use the main menu to go to another page, I still hold the lock on that object even though I'm not currently editing. We could use the "onunload" event to release the lock held for that page. This would reduce unnecessary "another user is editing this object" messages.
Would need to make sure this didn't release locks immedaitely when I click the "submit" button!
Adding this feature would allow us to extend the normal lock length substantially without worrying about 'dead sessions' hogging the lock for too long. Eg. Currently, if the lock length was 60 minutes, and Sam started editing an object but then gave up and closed her browser, nobody else could edit that object for 60 minutes. But if we added release-locks-on-page-unload, it wouldn't be a problem.
see https://github.com/tbar0970/jethro-pmm/issues/824