ArcadeData / arcadedb

ArcadeDB Multi-Model Database, one DBMS that supports SQL, Cypher, Gremlin, HTTP/JSON, MongoDB and Redis. ArcadeDB is a conceptual fork of OrientDB, the first Multi-Model DBMS. ArcadeDB supports Vector Embeddings.
https://arcadedb.com
Apache License 2.0
469 stars 57 forks source link

Cannot delete file used for database import #1627

Open dijef opened 1 month ago

dijef commented 1 month ago

ArcadeDB Version:

24.5.1, embedded installation (I believe it applies to server too)

OS and JDK Version:

Windows 11, Adoptium 21.0.1+12

Expected behavior

After import from file completes, I expect process to close file streams so I can delete it.

Actual behavior

After import from file completes, file is in use and cannot be deleted. It may apply to other formats than 'graphson' also.

Steps to reproduce

Import attached file: db_20240606t103727.gz

Must rename the file from db_20240606t103727.gz to db_20240606t103727.graphson (it does not detect format correctly otherwise) after download.

Use code written below:

Database db = null; // define local database here
Path path = Paths.get(path_to_file);
db.begin();
new com.arcadedb.integration.importer.Importer(db, path.toString()).load();

I reach same behaviour when using SQL IMPORT and EXPORT statement, however I use direct Java API as I need control over the file.