-
i am trying to process and insert a lot of data across multiple threads, using multiple connections to a single database table. of course this can't happen without some form of concurrency primitive usage, and from what i have gathered, i enabled it and was still having issues in the form of: SqliteFailure(
Error {
code: DatabaseBusy,
extended_code: 5,
},
Some(
"database is locked",
),
), i found that if you make a transaction that first does a read, then tries to do a write, the process of upgrading the concurrency lock from read to write will immediately fail if the database gets an exclusive lock. so i tried changing my transaction behavior from this helped alot, but some statements are still failing with the same error. where am i going wrong? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
https://sqlite.org/rescode.html#busy
|
Beta Was this translation helpful? Give feedback.
-
SQLITE_BUSY usually means you have multiple threads with write transactions open, and at least one of them holds the lock longer than the busy timeout. It's best to avoid this kind of thing by design, if possible, although doing so can be very difficult. |
Beta Was this translation helpful? Give feedback.
-
alright so my problem then is conflating |
Beta Was this translation helpful? Give feedback.
https://sqlite.org/rescode.html#busy