Hi, i'm experimenting with mapdb-3.0.8 and tried tempFileDB()
but one problem is that the file is created with a timestamp, therefore the
file.delete() that is executed right after, won't clean up previous tempFiles.
And then the deleteOnExit() has no effect, because the file is still in use,
even after calling db.close().
I also tried to use closeOnJvmShutdownWeakReference and closeOnJvmShutdown instead of the groovy addShutdownHook to no avail.
And fileDeleteAfterClose in combination with fileDB.
Any tip what might be the problem, why the datafile is still locked for changes? I can deleted it manually though, but a new File(...).delete() will return false
Hi, i'm experimenting with mapdb-3.0.8 and tried
tempFileDB()
but one problem is that the file is created with a timestamp, therefore thefile.delete()
that is executed right after, won't clean up previous tempFiles. And then thedeleteOnExit()
has no effect, because the file is still in use, even after callingdb.close()
.My snippet:
I also tried to use
closeOnJvmShutdownWeakReference
andcloseOnJvmShutdown
instead of the groovyaddShutdownHook
to no avail. AndfileDeleteAfterClose
in combination withfileDB
.Any tip what might be the problem, why the datafile is still locked for changes? I can deleted it manually though, but a
new File(...).delete()
will returnfalse
-- Windows 10, Groovy 2.5.4