B4J Question Add "wal" to an existing sqlite database

moster67

Expert
Licensed User
I created a sqlite db in an external program in which I imported csv-files exported from an old Access97 database. Now I am using it with a B4J-server app.

I just realized that there is only one file db-file now. The files related to "wal" are not present.
I know that when creating the database within B4J, we can use
B4X:
sqlite.ExecNonQuery("PRAGMA journal_mode = wal")
to add support.

Is it possible to add support, like in my case, to an existing database?

If not, I guess I will need to recreate everything from scratch (and from B4J) and then import the tables.
 
Last edited:

moster67

Expert
Licensed User
Which OS?
Created locally on Windows 10 and then moved to an Ubuntu server.
According to this query,
B4X:
select sqlite_version();
I am on 3.27.2 which I believe is among the latest ones.

I believe I used "DB Browser for SQLite" to create the DB and import the tables. I will try to start over creating the DB from B4J and only then use the DB Browser for importing the tables.
 

Harris

Well-Known Member
Licensed User
I always contend that SQLite was built for mobile devices. I suggest avoid using on servers.
It (SQLite) works great on mobile (A and i).
When trying to shoe-horn it into servers - problems arise (wal), such as this one.

All my mobile devices use SQLite - and the servers (which receive data from mobile) use RDC (j) or some other method (many) to accept the data (MySQL, MSSQL,etc).
Works perfect and no loss of hair - since that was lost many years ago on the head board!

My 2 pesos...

Thanks
 

Erel

Administrator
Staff member
Licensed User
It depends. I run many "utility" servers and many of them use SQLite databases. It shouldn't be difficult to use wal mode.

I agree that for production solution a database server with proper administration tools will be a better option.
 

moster67

Expert
Licensed User
I got eventually everything sorted by creating the DB in B4J and then importing the tables in DB Browser. It runs in Wal now.

I am using the sqlite for sign ups to a newsletter so for this purpose it ought to be fine. Otherwise I also would use a more robust solution.
 

avalle

Active Member
Licensed User
I was able to activate wal from DB Browser for SQLite:
1. Open the DB
2. Select the Edit Pragmas tab
3. Under the Journal Mode dropdown select WAL
4. Click Save at the bottom right
 
Top