Android Question sqlite journal

DPaul

Active Member
Licensed User
Longtime User
Hi,

I am observing unexpected behaviour while creating sqlite databases.
Setup:
I delete all previous user databases from dirRoot external = empty.
Application starts and creates 2 databases, but checks if the names exist,
it uses a numbering system to keep them apart.
The first time it will create a(1).db and a(1).db-journal (and also b(1).db etc..)

On subsequent application runs, it creates a(2).db and b(2).db ..(4)...(5)...etc.
but seems to make NO journals anymore. Since this is a system thing,
it can't be influenced by my code.

(It causes me some headaches in retrieving the database names)
?
thx,
Paul
 

DPaul

Active Member
Licensed User
Longtime User
Why ?: because this behaviour seems to be erratic. I'm struggling with this since my forum question last week.
If i look for *.db, all things starting with .db come up in the dialog, also the odd "*.db-journal" file.
To the user, this looks like a duplicate, and the poor man is confused.
If i look for *.db-journal, it only gives me the journal files, if any.

?confused?
Paul
 
Upvote 0

DPaul

Active Member
Licensed User
Longtime User
Well, yes, thanks for the workaround, that is always a solution, but not for the regular file.open dialog.
I would like to understand what is going on, but maybe that is a tall order in the sqlite/android environment.

I have been observing further and am now at my (7)th run.
#(6) and #(7) have no "db-journal" version but in the mean time, #(4) and #(5) showed up.
When i create #(8), i'm happy to report that #(6) journal shows up
Could the file manager be playing tricks ?
Or is the "file exists check", the trigger ? But why with a delay of 2 versions?
Or should i just accept it :)
thx,
Paul
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Upvote 0

DPaul

Active Member
Licensed User
Longtime User
There is no standard file picker in Android. I'm not sure which one are you using

1. I'm using what i found in the documentation: "Dim fd as filedialog....etc"
2. I had found the class by mr. Informatics already and downloaded it. Impressive piece of work,
but i failed to see why i should add 1.000 lines of extra code , for exactly 3 seconds of usage per run.
3. The good news is that, with some testing, i understand how the very simple (sub 1.) behaves.
Adding a line of creative coding , makes it do exactly what i wanted, a simple file picker for only 1 specific file extension .
It might be a good idea to be a little more verbose in the documentation about how filedialog behaves to save some time.
I have seen in the forum that others thought some things were impossible, i find they are. But these may have been old posts.
Paul
 
Upvote 0
Top