Reputation: 39164
I have a Java application connected to a sqlite database through jdbc. Sometimes executing an update don't work. The SQL syntax is right, no exception is thrown and the return value of executeUpdate is 1. The statement is closed after the execution.
I have found a workaround to this situation closing the connection to the database after executing the query, but I don't like this approach.
What could be the problem?
Upvotes: 0
Views: 374
Reputation: 121
Are you using multiple threads to access the database? SQLite is single threaded (sort of see http://www.sqlite.org/cvstrac/wiki?p=MultiThreading). As mentioned there, "Do not use the same database connection at the same time in more than one thread".
Upvotes: 1