I'm currently using SQLite in my Java chat application on server side, everything works fine when I use one connection, but because on server side I have many threads I would like to use connection pool. The problem with this is that database becomes locked after updating it, and it can't be accessed by any other connection from another thread. Temporary I have limited connections in pool to 1. Is there a way to make SQLite work with multiple connections in Java. I'm using JDBC driver org.sqlite.JDBC
-
2sqlite allows concurrent readers, but when a write/modification needs to be done, that connection must aquire an exclusive lock on the db(this means no readers can still be reading during a write). Maybe you need to clean up your readers?goat– goat2012年12月26日 17:49:02 +00:00Commented Dec 26, 2012 at 17:49
1 Answer 1
See here
You can opt for H2 database, who can run as an embedded database (like SQLLite) but supporting good multithreading, and client/server communication.