Codename One & SQLite consecutive tests & receiving java.lang.UnsatisfiedLinkError org.sqlite.NativeDB._open(Ljava/lang/String;I)V exception

Viewed 86

I am trying to run consecutive tests with codename one.

The first test opens the simulator and accesses a sqlite database and returns true and closes that simulator. The next test opens another simulator and runs that test, but this one doesn't access the db so I'm assuming why that test also returns true.

The third test however does access the db, and this is where the exception happens.

 [java] [EDT] 0:0:0,949 - Exception: java.lang.UnsatisfiedLinkError - org.sqlite.NativeDB._open(Ljava/lang/String;I)V
 [java] java.lang.UnsatisfiedLinkError: Native Library C:\Users\cocoa\AppData\Local\Temp\sqlite-3.7.151-amd64-sqlitejdbc.dll already loaded in another classloader
 [java] java.lang.UnsatisfiedLinkError: org.sqlite.NativeDB._open(Ljava/lang/String;I)V

I've searched around and I'm assuming it's happening because the .dll is not being unloaded and the tests are trying to load it again. Is there a way to unload the .dll, or a workaround so that consecutive tests work?

I'm using sqlite-jdbc-3.23.1.jar (latest version)

1 Answers
Related