File_lock=NO not working

261 views
Skip to first unread message

Sambasiva Narne

unread,
Nov 25, 2020, 2:29:24 PM11/25/20
to H2 Database
Hi

Am using H2-1.4.200.jar and need to connect this database from multiple instances, so creating with below cmd
jdbc:h2:c:/h2data/testdb;MODE=DB2;FILE_LOCK=NO

Even though i have specified File_lock=NO, still facing error the file is locked when connecting from other instance.

Please advise.

Evgenij Ryazanov

unread,
Nov 25, 2020, 10:53:35 PM11/25/20
to H2 Database
Hello.

You cannot connect to the same file from multiple instances of H2. You need to use the standalone H2 Server process and use remote connections to it (this way is safer), or you can use the automatic mixed mode (https://h2database.com/html/features.html#auto_mixed_mode), but with mixed mode you need to make sure that you use exactly the same version of H2 in all your processes and you should avoid abnormal termination of these processes.
Reply all
Reply to author
Forward
0 new messages