db-journal files in \database

Started by tramp20, November 17, 2012, 07:37:23

0 Members and 1 Guest are viewing this topic.

tramp20

Hi menion,
since several weeks (?) I find after track recording and closing Locus some times a tracks.db-journal and a waypoints.db-journal, all with the same date and time of the main databases.
When I restart Locus then the journal files disappeared.

Of course I had no crash of Locus 2.7.3 or another FC.

Do close Locus too early before the transaction files are committed?
My tracks.db has 20 MB.
Sony Xperia Z1c     Android 11 LOS 18.1
Sony Xperia 5 ii      Android 12
Samsung S23 Ultra Android 14

User ID acc406201
  •  

Menion

#1
I think all is fine in this case. Locus itself take few seconds till completely close and mainly, android databases have (as I read). quite powerful selfprotection system. journal file is just from last transaction and is probably deleted when new transaction begin, not when transaction ends, so I don't see any problem here
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

tramp20

#2
Quote from: "menion"so I don't see any problem here

Thank you, I will hope so.
Sony Xperia Z1c     Android 11 LOS 18.1
Sony Xperia 5 ii      Android 12
Samsung S23 Ultra Android 14

User ID acc406201
  •  

tramp20

#3
I have to come back to this problem:
I switch sometimes between Zeus 7.0.x GB 2.3.4 and CM10 JB 4.1.2 (of course with a different sdcard each time).

After I closed Locus under GB there is no db-journal left.
After I closed Locus under JB there are every time two db-journal files and they are never closed even I restart Locus. They get only a new date/time.

I think it is not correct for the health of a database that the db-journal remains there.
Sony Xperia Z1c     Android 11 LOS 18.1
Sony Xperia 5 ii      Android 12
Samsung S23 Ultra Android 14

User ID acc406201
  •  

tramp20

#4
Quote from: "tramp20"I have to come back to this problem:
I switch sometimes between Zeus 7.0.x GB 2.3.4 and CM10 JB 4.1.2 (of course with a different sdcard each time).

After I closed Locus under GB there is no db-journal left.
After I closed Locus under JB there are every time two db-journal files and they are never closed even I restart Locus. They get only a new date/time.

I think it is not correct for the health of a database that the db-journal remains there.

Could you read this again if you have some time left?
Sony Xperia Z1c     Android 11 LOS 18.1
Sony Xperia 5 ii      Android 12
Samsung S23 Ultra Android 14

User ID acc406201
  •  

Menion

#5
I have already read it but have no answer. I was searching a little bit in which cases Android create and use journal files. In almost 100% of response, author wrote text that android database system is fool proof and you (as a developer) have not worry about it. On second side, I'm still receiving some emails with database problems so it's not so optimistic.

So best response to you is that do not depend on this topic ... I'm still searching for best and most safe way how to handle with precious databases. Yesterday I did some small changes so we'll see if this helps
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

tramp20

#6
Thanks.
A new info:
If I start Locus on GB 2.3.4 with these database file incl. the not closed db-journal files from JB 4.1.2 then the transaction files are closed (committed) correctly.
This does never occur in JB, they always exist and only get a new timestamp if I open Locus.

And of course they are not included in your backups.
Sony Xperia Z1c     Android 11 LOS 18.1
Sony Xperia 5 ii      Android 12
Samsung S23 Ultra Android 14

User ID acc406201
  •  

tramp20

#7
Quote from: "menion"Yesterday I did some small changes so we'll see if this helps

Sorry, no change with the 2.7.4.3.
Sony Xperia Z1c     Android 11 LOS 18.1
Sony Xperia 5 ii      Android 12
Samsung S23 Ultra Android 14

User ID acc406201
  •  

Menion

#8
hmm don't know ... I played with it at the morning and

1. start locus (no journal)
2. open any point category (no journal)
3. start fill altitude (it start transaction > fill data > end transaction) (journal created!) - no error!
4. after few minutes of inactivity - journal still exists
5. closing locus (journal exist with date from step 3)

I don't think there should be any problem with it. It just instead of deleting this journal after successful commit, leave it be and delete it when new transaction starts

EDIT:

http://www.sqlite.org/tempfiles.html

section 2.1 "The rollback journal is usually created and destroyed at the start and end of a transaction, respectively. But there are exceptions to this rule. "
- Official help (ideas, questions, problems): help.locusmap.eu
- Advanced topics, sharing of knowledges: you're here!
- LM 4 Beta download, LM 4 Release download
  •  

tramp20

#9
Quote from: "menion"I don't think there should be any problem with it. It just instead of deleting this journal after successful commit, leave it be and delete it when new transaction starts


OK, thank you.
Sony Xperia Z1c     Android 11 LOS 18.1
Sony Xperia 5 ii      Android 12
Samsung S23 Ultra Android 14

User ID acc406201
  •