refer to already extracted library files, to avoid tmp files produced by SQLiteJDBCLoader, which tend to remain after JVM crash;
authorwenzelm
Sun, 21 May 2017 21:43:00 +0200
changeset 65890 1b004f5974af
parent 65889 29c9e3742069
child 65891 586911118317
refer to already extracted library files, to avoid tmp files produced by SQLiteJDBCLoader, which tend to remain after JVM crash;
Admin/components/components.sha1
Admin/components/main
src/Pure/General/sql.scala
--- a/Admin/components/components.sha1	Sun May 21 20:12:25 2017 +0200
+++ b/Admin/components/components.sha1	Sun May 21 21:43:00 2017 +0200
@@ -169,6 +169,7 @@
 b447017e81600cc5e30dd61b5d4962f6da01aa80  scala-2.8.1.final.tar.gz
 5659440f6b86db29f0c9c0de7249b7e24a647126  scala-2.9.2.tar.gz
 43b5afbcad575ab6817d2289756ca22fd2ef43a9  spass-3.8ds.tar.gz
+b016a785f1f78855c00d351ff598355c3b87450f  sqlite-jdbc-3.18.0-1.tar.gz
 b85b5bc071a59ef2a8326ceb1617d5a9a5be41cf  sqlite-jdbc-3.18.0.tar.gz
 8d20968603f45a2c640081df1ace6a8b0527452a  sqlite-jdbc-3.8.11.2.tar.gz
 2369f06e8d095f9ba26df938b1a96000e535afff  ssh-java-20161009.tar.gz
--- a/Admin/components/main	Sun May 21 20:12:25 2017 +0200
+++ b/Admin/components/main	Sun May 21 21:43:00 2017 +0200
@@ -15,6 +15,6 @@
 scala-2.12.2
 ssh-java-20161009
 spass-3.8ds
-sqlite-jdbc-3.18.0
+sqlite-jdbc-3.18.0-1
 xz-java-1.6
 z3-4.4.0pre
--- a/src/Pure/General/sql.scala	Sun May 21 20:12:25 2017 +0200
+++ b/src/Pure/General/sql.scala	Sun May 21 21:43:00 2017 +0200
@@ -384,7 +384,19 @@
   // see https://www.sqlite.org/lang_datefunc.html
   val date_format: Date.Format = Date.Format("uuuu-MM-dd HH:mm:ss.SSS x")
 
-  lazy val init_jdbc: Unit = Class.forName("org.sqlite.JDBC")
+  lazy val init_jdbc: Unit =
+  {
+    val lib_path = Path.explode("$ISABELLE_SQLITE_HOME/" + Platform.jvm_platform)
+    val lib_name =
+      File.find_files(lib_path.file) match {
+        case List(file) => file.getName
+        case _ => error("Exactly file expected in directory " + lib_path.expand)
+      }
+    System.setProperty("org.sqlite.lib.path", File.platform_path(lib_path))
+    System.setProperty("org.sqlite.lib.name", lib_name)
+
+    Class.forName("org.sqlite.JDBC")
+  }
 
   def open_database(path: Path): Database =
   {