Reserve the write lock up front.
Section: Transactions and savepoints
Begin an IMMEDIATE transaction
sql
sql
BEGIN IMMEDIATE;Explanation
Useful when you know the transaction will write and want to fail early if the database is busy.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Transactions and savepoints