I'm using Maven on NetBeans to import H2 Database to my project and the following code to init. a simple embedded database:
//...
Class.forName("org.h2.Driver");
//...
connection = DriverManager.getConnection("jdbc:h2:~/MCUsers");
//...
When I run the code on my Windows machine (where I do the programming), it works fine and I can create tables and rows. But when I run the same JAR file on my Linux machine, I get the following error:
Error Code:90020 Message:Database may be already in use: null. Possible solutions: close all other connection(s); use the server mode [90020-194] Cause:java.lang.IllegalStateException: The file is locked: nio:/root/MCUsers.mv.db [1.4.194/7]
- The same JAR runs on my Windows machine with no problems.
- There are no other Java programs running on my Linux machine.
- I already tried to reboot the system - didn't work.
- Only The files MCUsers.mv.db & MCUsers.trace.db are created in the root directory after this error occurs.
- My Linux machine uses JRE1.8.0_112 to execute the JAR file.
Edit: Adding "FILE_LOCK=NO;" also didn't work.