Thanks Clemens

-what do you mean by journal file is created only when needed ? Is it not true, 
that for any transactions it is always created. The documentation here 
https://www.sqlite.org/tempfiles.html says in exclusive mode it is created at 
the start of first transaction and not deleted until the exclusive mode is 
exited. So I am guessing in this mode ,a journal file should always be present ?

-I don't have journal mode setting. Again based on the documentation  at 
https://www.sqlite.org/tempfiles.html the journal file should always be 
present. Please let me know if my understanding is wrong. My question is does a 
non zero size of journal file indicate its hot and has not been used to recover 
the transaction. I see the journal file at 15 mb in one case although the 
sqlite application is still running. What does that mean? After a  transaction 
has been receovered using the journal file, should its size go to zero ?

-is there a tool I could write to figure out if a journal file is hot or not 
and recover lost transactions from it ?


-mayank


-----Original Message-----
From: sqlite-users-bounces at mailinglists.sqlite.org 
[mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Clemens 
Ladisch
Sent: Wednesday, July 15, 2015 5:43 AM
To: sqlite-users at mailinglists.sqlite.org
Subject: Re: [sqlite] journal file and its size

Mayank Kumar (mayankum) wrote:
> Sometimes we see the journal file not present on the system although 
> active transactions are ongoing. How is that possible since the 
> documentation says the journal file is always created in exclusive 
> mode ?

The journal file is created only when it is needed.

The journal file is not needed for the locking itself; the exclusive lock is on 
the database file.

> sometimes on our customers setup, we have seen a journal file of size 
> 10-20MB. Does that mean that the journal is still hot and has not been 
> used to recover or rollback ?

That depends on the PRAGMA journal_mode setting.

In the default DELETE mode, the journal file would be deleted on the COMMIT, so 
it being there implies that it's hot.


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
sqlite-users at mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to