Do SQLite queries also need Begin / Commit?
Posted: Tue Feb 15, 2022 4:50 am
I have a question about using transactions in SQLite.
I wrap writing functions like Update, Insert and Delete between Begin Immediate and Commit statements. This locks the database so only one user can work with it while writing. I have never used Begin / Commit for ordinary queries. My question is: Should the Begin / Commit structure also be used for queries and read-only actions?
This would presumably restrict access to one user at a time. At present I only use Begin...Commit when updating the database, not for queries. If someone is writing others wanting to use the database file are put into a queue and wait until the writer has finished. Is there a timeout?
I wrap writing functions like Update, Insert and Delete between Begin Immediate and Commit statements. This locks the database so only one user can work with it while writing. I have never used Begin / Commit for ordinary queries. My question is: Should the Begin / Commit structure also be used for queries and read-only actions?
This would presumably restrict access to one user at a time. At present I only use Begin...Commit when updating the database, not for queries. If someone is writing others wanting to use the database file are put into a queue and wait until the writer has finished. Is there a timeout?