Reputation: 11138
When I have opened and connected HSQL DB Manager (Swing), Java code can't connect to database throwing this:
java.sql.SQLException: Database lock acquisition failure: lockFile: org.hsqldb.persist.LockFile@cf53680[file =C:\somedb\db.lck ...
But as soon as I close the connection to database from Database Manager, Java code starts to work fine.
What is this?
Upvotes: 1
Views: 931
Reputation:
HSQLDB is primarily an embedded database engine. That means that if you run it embedded, only one process (=JVM) can use the database. Connections from other processes are not possible.
The only way around that is to start HSQLDB in server mode where HSQLDB runs in its own process (JVM) and accepts connections from other processes - essentially the same setup as a "traditional" database server like Postgres or Oracle.
Details on how to start HSQLD in server mode are documented in the manual:
http://hsqldb.org/doc/2.0/guide/running-chapt.html#rgc_server_modes
Upvotes: 3