database.\r\norg.h2.jdbc.JdbcSQLException: Database may be already in use: "Locked by another process"

I found this issue at,

which says it has been solved as of version 8.0.1 but I am on version 8.0.3 and am still seeing the database locked error. Or some type of h2 error. I am using GPT on the command line and this happens under tasks such as interferogram formation in sentinel 1 tool box.

In the below code it states this as a possible solution.

Possible solutions: close all other connection(s); use the server mode [90020-197]\r\n\tat org.h2.message.DbException.getJdbcSQLException(Db

b’INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: GDAL not found on system. Internal GDAL 3.0.0 from distribution will be used. (f1)\r\nINFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.\r\nSEVERE: org.esa.snap.product.library.v2.activator.ProductLibraryActivator: Failed to in

itialize the database.\r\norg.h2.jdbc.JdbcSQLException: Error opening database: “Concurrent update” [8000-197]\r\n\tat org.h2.message.DbException.getJdbcSQLException(DbException.java:357)\r\n\tat org.h2.message.DbException.get(DbException.java:168)\r\n\tat org.h2.store.FileLock.getExceptionFatal(FileLock.java:4

28)\r\n\tat org.h2.store.FileLock.lockFile(FileLock.java:336)\r\n\tat org.h2.store.FileLock.lock(FileLock.java:108)\r\n\tat org.h2.engine.Database.open(Database.java:674)\r\n\tat org.h2.engine.Database.openDatabase(Database.java:286)\r\n\tat org.h2.engine.Database.(Database.java:280)\r\n\tat org.h2.engine

.Engine.openSession(Engine.java:66)\r\n\tat org.h2.engine.Engine.openSession(Engine.java:179)\r\n\tat org.h2.engine.Engine.createSessionAndValidate(Engine.java:157)\r\n\tat org.h2.engine.Engine.createSession(Engine.java:140)\r\n\tat org.h2.engine.Engine.createSession(Engine.java:28)\r\n\tat org.h2.engine.Sessio

nRemote.connectEmbeddedOrServer(SessionRemote.java:351)\r\n\tat org.h2.jdbc.JdbcConnection.(JdbcConnection.java:124)\r\n\tat org.h2.jdbc.JdbcConnection.(JdbcConnection.java:103)\r\n\tat org.h2.Driver.connect(Driver.java:69)\r\n\tat java.sql.DriverManager.getConnection(DriverManager.java:664)\r\n\tat

java.sql.DriverManager.getConnection(DriverManager.java:208)\r\n\tat org.esa.snap.product.library.v2.database.DataAccess.getConnection(DataAccess.java:1063)\r\n\tat org.esa.snap.product.library.v2.database.DataAccess.upgradeDatabase(DataAccess.java:82)\r\n\tat org.esa.snap.product.library.v2.activator.ProductL

ibraryActivator.start(ProductLibraryActivator.java:27)\r\n\tat org.esa.snap.runtime.Engine.informActivators(Engine.java:222)\r\n\tat org.esa.snap.runtime.Engine.lambda$start$0(Engine.java:121)\r\n\tat org.esa.snap.runtime.Engine.runClientCode(Engine.java:189)\r\n\tat org.esa.snap.runtime.Engine.start(Engine.jav

a:121)\r\n\tat org.esa.snap.runtime.Engine.start(Engine.java:90)\r\n\tat org.esa.snap.runtime.Launcher.run(Launcher.java:51)\r\n\tat org.esa.snap.runtime.Launcher.main(Launcher.java:31)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(Native

MethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:84)\r\n\tat com.exe4j.runtime.WinLauncher.main(WinLauncher.java:9

4)\r\n\tat com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:25)\r\n\r\nINFO: org.esa.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters\r\nINFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experi

ence.\r\nINFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.\r\nINFO: org.hsqldb.persist.Logger: dataFileCache open start\r\nExecuting operator…\r\n20%…30%…40%…50%…60%…70%…80%…90%… done.\r\nINFO: org.esa.snap.core.gpf.common.WriteOp: Start writing p

roduct

b’INFO: org.esa.s2tbx.dataio.gdal.GDALVersion: GDAL not found on system. Internal GDAL 3.0.0 from distribution will be used. (f1)\r\nINFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.\r\nSEVERE: org.esa.snap.product.library.v2.activator.ProductLibraryActivator: Failed to in

itialize the database.\r\norg.h2.jdbc.JdbcSQLException: Database may be already in use: “Locked by another process: C:/Users/clayc/.snap/product-library/products.lock.db”. Possible solutions: close all other connection(s); use the server mode [90020-197]\r\n\tat org.h2.message.DbException.getJdbcSQLException(Db

Exception.java:357)\r\n\tat org.h2.message.DbException.get(DbException.java:179)\r\n\tat org.h2.message.DbException.get(DbException.java:155)\r\n\tat org.h2.store.FileLock.getExceptionAlreadyInUse(FileLock.java:433)\r\n\tat org.h2.store.FileLock.lockFile(FileLock.java:325)\r\n\tat org.h2.store.FileLock.lock(Fil

eLock.java:108)\r\n\tat org.h2.engine.Database.open(Database.java:674)\r\n\tat org.h2.engine.Database.openDatabase(Database.java:286)\r\n\tat org.h2.engine.Database.(Database.java:280)\r\n\tat org.h2.engine.Engine.openSession(Engine.java:66)\r\n\tat org.h2.engine.Engine.openSession(Engine.java:179)\r\n\ta

t org.h2.engine.Engine.createSessionAndValidate(Engine.java:157)\r\n\tat org.h2.engine.Engine.createSession(Engine.java:140)\r\n\tat org.h2.engine.Engine.createSession(Engine.java:28)\r\n\tat org.h2.engine.SessionRemote.connectEmbeddedOrServer(SessionRemote.java:351)\r\n\tat org.h2.jdbc.JdbcConnection.(Jd

bcConnection.java:124)\r\n\tat org.h2.jdbc.JdbcConnection.(JdbcConnection.java:103)\r\n\tat org.h2.Driver.connect(Driver.java:69)\r\n\tat java.sql.DriverManager.getConnection(DriverManager.java:664)\r\n\tat java.sql.DriverManager.getConnection(DriverManager.java:208)\r\n\tat org.esa.snap.product.library.v

2.database.DataAccess.getConnection(DataAccess.java:1063)\r\n\tat org.esa.snap.product.library.v2.database.DataAccess.upgradeDatabase(DataAccess.java:82)\r\n\tat org.esa.snap.product.library.v2.activator.ProductLibraryActivator.start(ProductLibraryActivator.java:27)\r\n\tat org.esa.snap.runtime.Engine.informAct

ivators(Engine.java:222)\r\n\tat org.esa.snap.runtime.Engine.lambda$start$0(Engine.java:121)\r\n\tat org.esa.snap.runtime.Engine.runClientCode(Engine.java:189)\r\n\tat org.esa.snap.runtime.Engine.start(Engine.java:121)\r\n\tat org.esa.snap.runtime.Engine.start(Engine.java:90)\r\n\tat org.esa.snap.runtime.Launch

er.run(Launcher.java:51)\r\n\tat org.esa.snap.runtime.Launcher.main(Launcher.java:31)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)\r\n\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethod

AccessorImpl.java:43)\r\n\tat java.lang.reflect.Method.invoke(Method.java:498)\r\n\tat com.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:84)\r\n\tat com.exe4j.runtime.WinLauncher.main(WinLauncher.java:94)\r\n\tat com.install4j.runtime.launcher.WinLauncher.main(WinLauncher.java:25)\r\n\r\nINFO: org.esa

.snap.core.gpf.operators.tooladapter.ToolAdapterIO: Initializing external tool adapters\r\nINFO: org.esa.snap.core.util.EngineVersionCheckActivator: Please check regularly for new updates for the best SNAP experience.\r\nINFO: org.esa.s2tbx.dataio.gdal.GDALVersion: Internal GDAL 3.0.0 set to be used by SNAP.\r\

nINFO: org.hsqldb.persist.Logger: dataFileCache open start\r\nExecuting operator…\r\n20%-- org.jblas INFO Starting temp DLL cleanup task.\r\n…30%…40%…50%…60%…70%…80%…90%…100% done.\r\nINFO: org.esa.snap.core.gpf.common.WriteOp: Start writing product

1 Like

Hello,
The ticket SNAP-1359 you mentioned was created and solved for

Are you on 8.0.3 for s1tbx or also for SNAP Engine & Desktop? (you can check this fast either in Help -> About SNAP or in Tools -> Plugins -> Updates.

Also, some steps to reproduce would help.

Yes, everything is 8.0.3. s1tbx, and the SNAP engine and desktop.

What I think is happening is me running multiple gpt.exe, I am running s1tbx steps for InSAR processing through the command line using gpt.exe. For example, I have the two SLCS, and one of the steps is TOP-SAR split, I have some code to submit 6 commands (to the command line) in parallel for example,

gpt.exe TOP-SAR split IW1 SLC1
gpt.exe TOP-SAR split IW2 SLC1
gpt.exe TOP-SAR split IW3 SLC1
gpt.exe TOP-SAR split IW1 SLC2
gpt.exe TOP-SAR split IW2 SLC2
gpt.exe TOP-SAR split IW3 SLC2

I have other steps in my processing chain where it also seems to produce this error, which seems to occur when I send multiple gpt.exe commands to the command line at once, but I think it is caused by me calling gpt.exe multiple times to process these steps in parallel versus doing them in a singular fashion. I wouldn’t expect this to be an issue but it seems like it might be trying to access the database multiple times but gets locked in use by one of these processes. I can find each step specifically where this error occurs if that would help.

I am experiencing the same issue with several SNAP/GPT S1tbx v8.0.3 instances running concurrently in Docker, sharing a common volume for auxiliary files.

Thank you for the report. We will try to reproduce and find a solution.
Just for info, this error should not impact the processing results.