Hello,

As stated in the documentation I see that:


A deferred transaction starts without a lock and obtains a SHARED lock on the first read and the first write operation creates a RESERVED lock.

An immediate acquires a RESERVED lock as soon as the BEGIN command is executed, without waiting for the database to be used.

An exclusive transaction causes EXCLUSIVE locks to be acquired on all databases. After a BEGIN EXCLUSIVE, you are guaranteed that no other thread or process will be able to read or write the database until the transaction is complete.


Then I see the following statement:


A PENDING lock is always just a temporary stepping stone on the path to an EXCLUSIVE lock and so the pager module does not track PENDING locks.


Does that mean that if there are readers accessing the database and I issue a BEGIN EXCLUSIVE, SQLite will create a PENDING lock barring new readers to have access? Then as soon as the current readers finish, the PENDING lock will be upgraded to an EXCLUSIVE lock, barring other readers and writers from accessing the database, correct?

Thanks,

-- Tito

Reply via email to