SQLite Journal File Enigma

Mahares

Expert
Licensed User
Longtime User
I inserted a record in a SQLite table. then I use the following code for the back key to exit the application:
B4X:
Answ = Msgbox2(txt," I N F O R M A T I O N","Yes","","No",LoadBitmap(File.DirAssets,"Warning-icon.png"))      
If Answ = DialogResponse.POSITIVE Then          
 Cursor1.Close
    SQL1.Close   
    Activity.Finish
MyDatabase.db-journal file is created. with 0B every time I insert a record, exit the application and come back. I have 3 separate applications and each has a corresponding journal file with 0B in size. Is it really supposed to be automatically deleted or is it the same as having one with 0B. I read the SQLite documentation about journal and it is as complex and twisted as the flow charts they have on their web site.
Thanks
 

Mahares

Expert
Licensed User
Longtime User
Thank you Erel and mc73. What do others who use SQLite on a daily or frequent basis say about journal files, closing SQL objects and anything that makes the database work smoothly, fast and efficient and avoiding corruption and locking of the database, vacuuming, etc. All of us can use some tips of any type regarding SQLite.
Thanks
 
Upvote 0

mc73

Well-Known Member
Licensed User
Longtime User
The db-journal left with 0b upon insertions but also queries, is an issue I started facing with multiple sql handling some time ago, ie from different modules, thus very similar to your case. I had been really busy with some things, hopefully I'll have some hours this weekend for checking such 'problems'. If I find something helpful, I'll notify immediately. In the mean time, and if you're not concerned too much about db copying, Erel's response can fully cover us.
 
Upvote 0

rboeck

Well-Known Member
Licensed User
Longtime User
I think, it is possible, to make different behaviors of the journal. In Sqllite you have following options for journal mode:delete, truncate, persist, memory, wal and off. I can imagine, the this problems come from the type of journal mode. For details look at:
Pragma statements supported by SQLite

Greetings
Reinhard
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
@mc73: I look forward to your findings if different from what we established so far.
@Reinhard: Thanks for the link. I already was there many times and sifted through it, but as all SQLite web site info, it is very sketchy and does not provide any concrete examples.
And for the rest, keep the tips coming.
Thank you
 
Upvote 0
Top