I am working on android sqLite database in which I am not able to insert record into DataBase.
In code I open database only once at the time of launch application, and I set there reference to my Application class variable so that I can access database from any part of code and this works fine.
Problem is: I can access the database, but I’m not able to beginTransaction. It does not give me any exception but sqLiteDatabaseWrite.isDbLockedByOtherThreads() returns TRUE. Also, in logcat there is one warning message:
WARN/SQLiteDatabase(19006): database lock has not been available for
30 sec. Current Owner of the lock is 1. Continuing to wait in thread:
14
Any solutions ?.
Thanks for being with me. Actually I resolved my issue. I started one SQLite DB operation by using
sqLiteDatabase.beginTransaction()and I forgot to end this transaction. I resolved the issue by ending the transaction. To end the transaction I used the following code:Thanks.