Prevent or delete sqlite-3.8.7-2....-sqlitejdbc.dll

202 views
Skip to first unread message

Marvin Klose

unread,
Nov 11, 2014, 2:14:46 PM11/11/14
to xer...@googlegroups.com
I use the Xerial driver for connections to SQLite database.
But my applications produces a lot .dll files. How to delete them or even stop creating them?

Thanks for your help :)
Marvin

Luis F.

unread,
Jun 4, 2016, 7:30:22 AM6/4/16
to Xerial
This also occurs with version 3.8.11.2.

Some help or workaround about this?

Thanks
Luis

Peter Pažák

unread,
Feb 2, 2017, 6:13:28 AM2/2/17
to Xerial
Hi, the driver is meant to be multi-platform, so inside of the jar there are native libraries packed, which are extracted to a temp directory when driver is loaded.
The problem is on windows these temporary files fail to be deleted most probably because system indicates the .dll file is still in use when java virtual machine is about to finish, so they stay there.
My workaround is mentioned below...

Peter Pažák

unread,
Feb 2, 2017, 6:20:40 AM2/2/17
to Xerial
I have taken the sources and slightly modified them. This breaks the multi-platform suitability, but resolves the above problem.
in SQLiteJDBCLoader.java:
String sqliteNativeLibraryPath = (new File(".").getAbsolutePath()).replace("\\.", "");
String sqliteNativeLibraryName = "sqlitejdbc.dll";

So it only searches for sqlitejdbc.dll in the current directory.
The advantages are: no delay on extracting the dll from jar AND no temporary file created that would remain after closing your application

Peter
Reply all
Reply to author
Forward
0 new messages