Locks

Overview

Database locks are tools designed to stop multiple transactions from altering identical data simultaneously or to prevent a transaction from accessing data that is undergoing modification by another transaction.

Acquire locks programmatically

You can acquire a lock programmatically by using Database Manager acquireLock method.

Example:

databaseManager.acquireLock(foundset,1,'myLock')

Release locks programmatically

You can release a lock programmatically by using Database Manager releaseAllLocks method. You can also release all locks by using Database Manager releaseAllLocks method.

Example:

databaseManager.releaseAllLocks('myLock'); //release specific lock
databaseManager.releaseAllLocks(); // release all locks

Viewing locks

Open locks

The admin page will show any open locks. If anything at all shows up here, it is likely a problem as locks should be only very briefly held.

Manually releasing locks

Here you can manually release any locks that are held, by clicking the X button corresponding to each lock. This can be used to avoid database issues.

Last updated

Was this helpful?