We are using sqlite056.jar in our code. While inserting into database in batch we are getting exception on line when we going to commit.
Lines of Code
<object of Connection>.commit();
<object of Connection>.setAutoCommit(true);
Exception
java.sql.SQLException: database locked
Connection needs to be closed after each query. If any of the connections still persist. I had got the same error on Java desktop apps, now solved.
Reading an SQLite database sets the locking state to Shared. Multiple readers can be active at the same time.
Writing to an SQLite database sets the locking state to Exclusive. No other processes can be active at that time.
You can find a detailed explanation on http://www.sqlite.org/lockingv3.html
It seems that more than one process is trying to modify the database. You can have only one connection open at any given time. More background on the problem may help us provide you with a more concrete answer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With