ontop and duckdb

67 views
Skip to first unread message

pasquale...@gmail.com

unread,
Aug 16, 2023, 11:10:41 AM8/16/23
to ontop4obda
Dear list,

I'm trying to use ontop with duckdb and get the following error:

... IO Error: cannot read file "test.duckdb" .... used by another process ..

Any hint will be appreciated. many thanks

Pasquale

Damian Rovara

unread,
Aug 30, 2023, 4:26:42 AM8/30/23
to ontop4obda
Hi Pasquale,

I have been working with Ontop with DuckDB quite a bit and have experienced this error one or two times, but it was usually caused by some incorrect way of handling the database file.
Here are some possible things I would recommend to try:

- Make sure that the database file ("test.duckdb") is not currently accessed by another application (for example by the duckdb CLI)
- Make sure the file actually exists (is there a typo in the file name etc...). Please also make sure you have specified the path correctly. Note that the path you indicate in the JDBC URL in the .properties file must be relative to the directory from which you are running Ontop, not relative to the directory of the properties file. If you are running Ontop through docker, make sure the container has access to the file and the permission to use it.
- Make sure there is no write access lock file ("test.duckdb.wal") in the directory of "test.duckdb". When duckdb is forcefully closed, it will not clean up the access lock file, which could also cause such issues. If such a file exists, just delete it.

If none of this works, please let me know. In that case I would also be interested in seeing your .properties file and checking if I can reproduce the problem myself.

Cheers,
Damian

pasquale...@gmail.com

unread,
Oct 19, 2023, 5:01:02 AM10/19/23
to ontop4obda
Dear Damian,

First, I apologize for the huge delay.
I'm running ontop in Powershell. I have the files test.db, test.properties and test.r2rml in the same directory of ontop.bat: there is no .wal file.
As soon as I run:

.\ontop.bat materialize -m test.r2rml -p test.properties

I get the above mentioned error and a .wal file is created in the same folder.
I attach the files so that you can try and check if you can reproduce.

many thanks
sincerely
Pasquale
test.db
test.properties
test.r2rml

Benjamin Cogrel

unread,
Jan 5, 2024, 9:28:15 AMJan 5
to pasquale...@gmail.com, ontop4obda
Hi Pasquale,

Sorry for the very late reply.

I tried to reproduce your issue with Ontop 5.1.1 and DuckDB 0.8.1 (the latest version compatible with your .db file) on Linux. 
It worked fine on my machine but it may be different on Windows.

DuckDB handles concurrency in a very different way than most databases: https://duckdb.org/faq.html#how-does-duckdb-handle-concurrency

One solution could be to set DuckDB in read-only mode:
jdbc.property.duckdb.read_only=true

Another idea is to limit the connection pool used by Ontop (Tomcat by default) to use only one connection:
jdbc.pool.maxSize=1
jdbc.pool.initialSize=1

I hope it helps,

Best,
Benjamin






--
Please follow our guidelines on how to report a bug https://ontop-vkg.org/community/contributing/bug-report
---
You received this message because you are subscribed to the Google Groups "ontop4obda" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ontop4obda+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ontop4obda/f9586017-a57f-41c3-97cf-f454e3155017n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages