I found a solution to my problem. I use a transaction, analyzing the data and inserting the data into the database. But between them I am trying to get some values ββfrom the database. So the hierarchy as shown below
<transaction> <Insert> <select> <insert> </transaction>
I am trying to run a select query in a database and the database in a transaction. Actually there is a solution here about concurrent transaction
The SQL command "BEGIN TRANSACTION" (the "BEGIN TRANSACTION" keyword is optional) is used to bring SQLite out of autosave mode. Note that the BEGIN command does not receive locks in the database. After the BEGIN command, a SHARED lock will be obtained when the first SELECT statement is executed. A RESERVED lock will be obtained upon execution of the first INSERT , UPDATE, or DELETE . The EXCLUSIVE lock is not retained until the memory cache is full and spilled to disk or until the transaction completes. Thus, the system delays the blocking of access for reading to the file file until the last moment.
I just deleted the query request lines from the code while the database is in a transaction
Edit
There is also one more solution: check enable false, for example
mDb.setLockingEnabled(false);
source share