My application manages all its data in SQLiteDatabase, which is accessed by several threads.
Currently, I support all my DB calls synchronized in the database itself.
The reason I want to do this is because sometimes I want to update the table by grabbing the latest version from the server and restoring the table from stratch. To save time, I actually do a second table and then replace the original when I finish (lock with sync while I do this).
The problem is either that sometimes SQL queries fail (due to synchronous locks), or I get an error when an SQL query tries to start itself in a short period when my single table is copied.
Do I have the opportunity to block my database from other operations while it is being updated, but do operations A, B, C, etc. allow it? work at the same time?
Hooray!
source
share