Locks the specified resource id so that it cannot be accessed by another user, returns false if
the lock could not be obtained because it's held by another user, otherwise returns true.
The #unlock(String, String) method should be used to release the lock when it's no longer required.
Locks are held in memory and are not persisted in any way; they are therefore not maintained across
a server restart, or in a clustered environment.
The system releases locks automatically when a form ends by the user navigating to the special final page,
or when WebForm#gotoForm(String, java.util.Map) or WebForm#gotoUrl(String, java.util.Map) are called.
In all other circumstances, locks must be explicitly released.
false
if the lock could not be obtained because it's held by another user, otherwise returnstrue
. The #unlock(String, String) method should be used to release the lock when it's no longer required.Locks are held in memory and are not persisted in any way; they are therefore not maintained across a server restart, or in a clustered environment. The system releases locks automatically when a form ends by the user navigating to the special final page, or when WebForm#gotoForm(String, java.util.Map) or WebForm#gotoUrl(String, java.util.Map) are called. In all other circumstances, locks must be explicitly released.