Does sqlite BEGIN EXCLUSIVE transaction on failure keep retrying for the duration of "busy_timeout"?

Viewed 208

Hi i am trying to understand if BEGIN EXCLUSIVE, BEGIN IMMEDIATE wait for the duration "busy_timeout", meaning they keep trying to lock the database until that amount of time has passed and only then return a failure of some kind.

I found this documentation for busy_timeout https://www.sqlite.org/c3ref/busy_timeout.html where it mentions that "This routine sets a busy handler that sleeps for a specified amount of time when a table is locked". So this is for table and not for a database?

I basically have different threads doing stuff on the database, so if one thread did a EXCLUSIVE LOCK on the database and a new thread does BEGIN EXCLUSIVE I don't want it fail immediately but keep tyring for a duration of time before throwing error.

Any links to officail documentation which deals with this issue are appreciated.

0 Answers
Related