B4J Question sqlite wal mode on Mac OS X


Active Member
Licensed User
Longtime User

My app uses keyvaluestore and I have enabled the wal mode for faster loading speed and multithread reading by add the code below in keyvaluestore's initialize sub:

sql1.ExecNonQuery("PRAGMA journal_mode = wal")

It works well in windows, but crashed in OS X. I got this error:

java.sql.SQLException: [SQLITE_NOTADB]  File opened that is not a database file (file is encrypted or is not a database)
    at org.sqlite.DB.newSQLException(DB.java:383)
    at org.sqlite.DB.newSQLException(DB.java:387)
    at org.sqlite.DB.throwex(DB.java:374)
    at org.sqlite.NestedDB.prepare(NestedDB.java:134)
    at org.sqlite.DB.prepare(DB.java:123)
    at org.sqlite.Stmt.execute(Stmt.java:113)
    at anywheresoftware.b4j.objects.SQL.ExecNonQuery(SQL.java:156)
    at b4j.example.keyvaluestore._createtable(keyvaluestore.java:62)
    at b4j.example.keyvaluestore._initialize(keyvaluestore.java:357)
    at b4j.example.tm._initialize(tm.java:1342)
    at b4j.example.project._initializetm(project.java:706)
    at b4j.example.project._open(project.java:826)
    at b4j.example.main._menubar1_action(main.java:487)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at anywheresoftware.b4a.BA.raiseEvent2(BA.java:90)
    at anywheresoftware.b4a.BA$1.run(BA.java:215)
    at com.sun.javafx.application.PlatformImpl.lambda$null$173(PlatformImpl.java:295)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl.lambda$runLater$174(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)

Database created by OS X works fine. But sqlite is not in wal mode.

I have attached the database created under windows.


  • externalTM.db.zip
    70.2 KB · Views: 218


Active Member
Licensed User
Longtime User
I solved it. It is the upstream sqlite-jrdc's problem. I downloaded the latest jar from here:download, and it works on Mac.
Upvote 0


Active Member
Licensed User
Longtime User
Hi, I have the same problem, with windows and tuttook, instead with mac nothing gives me the same error in post # 1, I had already changed qlite-jdbc-3.30.1.jarmailrultatonon does not change. how can i make the sqlite db work also with the mac?
What else do you have some application that makes a package for the mac, without starting with run.command?
thank you
Upvote 0