I need to read some data from a database meanwhile I'm loading some data in another thread with a transaction.
All my threads to read other tables are stopped until the transaction in other thread is finished.
I need to be able to read info from the database without worrying about the other thread.
I've read a lot of info about sqlite, android...but nothing is working, always my query to read parameters is blocked.
I've followed this advices as @KevinGalligan says in this thread (What are the best practices for SQLite on Android?) resolving locks and other problems.
1) I'm using only one SQLiteOpenHelper (singleton)
2) I've never closing the database
I've tried:
start the transaction with:
database.execSQL("begin immediate transaction");
or
database.beginTransactionNonExclusive();
instead
database.beginTransaction();
Not working, query blocked.
I've read about WAL(database.enableWriteAheadLogging()), but I need to support api 9.
Any other solutions to read meanwhile a transaction is updating some tables? I don't care if my info is deprecated, it's more important to not block my threads.