2

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

asked Dec 26, 2012 at 17:40
1
  • 2
    sqlite 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? Commented Dec 26, 2012 at 17:49

1 Answer 1

2

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.

answered Dec 26, 2012 at 18:20
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.