Can no longer run multiple gpt jobs at once since Ver 8.0.0

I have been starting multiple gpt jobs at once using gnu parallel in order to reduce processing time.

Now since version 8 I can only run one at a time or I get the following error:

Caused by: java.lang.IllegalStateException: The file is locked:nio:/home/hnw/.snap/product-library/ [1.4.197/7]

This database is present, and permissions seem fine. I can touch it and date refreshes to now.

Is this a known issue?


Bill H.

This looks interesting (besides the problem)… would you be willing to explain how do use SNAP and Parallel together? Thanks.

There’s a new version of the product library in SNAP8 but it should not influence how the GPT is used… @oana_hogoiu can you have a look from the product library side? @marpet can you confirm the GPT side?

I get this exception too.

SEVERE: org.esa.snap.product.library.v2.activator.ProductLibraryActivator: Failed to initialize the database.
org.h2.jdbc.JdbcSQLException: Datenbank wird wahrscheinlich bereits benutzt: null. M÷gliche L÷sungen: alle Verbindungen schliessen; Server Modus verwenden
Database may be already in use: null. Possible solutions: close all other connection(s); use the server mode [90020-197]
        at org.h2.message.DbException.getJdbcSQLException(
        at org.h2.message.DbException.get(
        at org.h2.mvstore.db.MVTableEngine$Store.convertIllegalStateException(
        at org.h2.mvstore.db.MVTableEngine$
        at org.h2.mvstore.db.MVTableEngine.init(
        at org.h2.engine.Database.getPageStore(
        at org.h2.engine.Database.openDatabase(
        at org.h2.engine.Database.<init>(
        at org.h2.engine.Engine.openSession(
        at org.h2.engine.Engine.openSession(
        at org.h2.engine.Engine.createSessionAndValidate(
        at org.h2.engine.Engine.createSession(
        at org.h2.engine.Engine.createSession(
        at org.h2.engine.SessionRemote.connectEmbeddedOrServer(
        at org.h2.jdbc.JdbcConnection.<init>(
        at org.h2.jdbc.JdbcConnection.<init>(
        at org.h2.Driver.connect(
        at java.sql.DriverManager.getConnection(
        at java.sql.DriverManager.getConnection(
        at org.esa.snap.product.library.v2.database.DataAccess.getConnection(
        at org.esa.snap.product.library.v2.database.DataAccess.upgradeDatabase(
        at org.esa.snap.product.library.v2.activator.ProductLibraryActivator.start(
        at org.esa.snap.runtime.Engine.informActivators(
        at org.esa.snap.runtime.Engine.lambda$start$0(
        at org.esa.snap.runtime.Engine.runClientCode(
        at org.esa.snap.runtime.Engine.start(
        at org.esa.snap.runtime.Engine.start(
        at org.esa.snap.runtime.Launcher.main(
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(
        at java.lang.reflect.Method.invoke(
        at com.exe4j.runtime.LauncherEngine.launch(
        at com.exe4j.runtime.WinLauncher.main(
        at com.install4j.runtime.launcher.WinLauncher.main(
Caused by: java.lang.IllegalStateException: The file is locked: nio:C:/Users/Marco/.snap/product-library/ [1.4.197/7]
        at org.h2.mvstore.DataUtils.newIllegalStateException(
        at org.h2.mvstore.MVStore.<init>(
        at org.h2.mvstore.MVStore$
        at org.h2.mvstore.db.MVTableEngine$
        ... 33 more

Good is that the exception text also provides a solution for it.

Database may be already in use: null. Possible solutions: close all other connection(s); use the server mode

Despite the exception the processing goes on normally and I got the processing results.

Currently the Product Library H2 database is used in embedded mode, which allows only 1 connection.
The error is thrown when a new connection is required (after an existing one).
However, this should not impact the gpt (it appears because it’s part of SNAP initialization).
Server mode should be used for H2 database, for allowing multiple connections.
I will create a JIRA ticket for this.