Locks
Last updated
Last updated
You can use lock using with_lock
method on query collection:
with_lock
offers optional parameters (default: "FOR UPDATE"
), to setup the lock options you want (ex: with_lock("FOR UPDATE SKIP LOCKED")
)
See PostgreSQL .
Lock work only inside transaction. Without transaction block, the call might fail.