Advisory locks
Advisory locks are application-enforced locks. Advisory locks are used to emulate pessimistic locking strategies. Advisory locks are acquired at session or transaction level and are released when the session ends or the transaction commits.
Advisory locks can be used to limit the concurrency to one process. For example, when the process starts, it tries to acquire a lock; if it acquires it successfully, it continues, otherwise it exits. Advisory locks enable the developers to treat the database system as a single user environment and relieves them of the complexity of the locking system.
Advisory locks are stored in memory, so you need to be careful not to exhaust the database cluster resources when using them. Finally, the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access