B4J Question PRAGMA Checkpoint

oldeast

Active Member
Licensed User
Longtime User
Using SQLite, I set the journal mode..
B4X:
SQL1.ExecNonQuery("PRAGMA journal_mode = WAL")
I want to update the database from the journal when the program closes.
Right now, if you make changes then close the program, the wal file does not close or update the database.
Follow that by opening and closing the program without any changes, the database is updated and the wal file is deleted
Reading SQLite documentation, I see that you can force a checkpoint.
How do a set a checkpoint in my code, is this correct?
B4X:
SQL1.ExecNonQuery("PRAGMA wal_checkpoint")
thanks.
 

oldeast

Active Member
Licensed User
Longtime User
B4X:
Sub btnClose_Action
    Dim Btn As Button

    Btn=Sender
    Select  Btn.Tag
        Case  "3"
            Pane3.Visible=False
        Case  "4"
            Pane4.Visible=False
        Case  "5"
            Pane5.Visible=False
        Case  "6"
            Pane6.Visible=False
        Case  "0"
            SQL1.close
            MainForm.Close
    End Select
End Sub
Thank you, yes I did include that statement, but for some reason that's works only on reopening and closing the program.
 
Last edited:
Upvote 0
Top