On 05/25/2016 10:54 PM, 박병언 wrote:
First of all, my English skill is not good. So please forgive me if my
sentences are rude.
I saw this is for anonymous user to report bug. I'm not sure If I need to
write down my personal information. So I didn't write my name. If I need
to, I'll send this information.
I am a Computer Science Master student in South Korea. I'm doing a research
to enhance the SQLite performance.
In PERSIST mode, journal is still remain. But the red code is always
generated in each transaction. That is, journal file descriptor is always
closed at the end of transaction and reopen at the start of next
transaction(I think this is a bug).
Do you think sync journal's directory per transaction is correct?
If this opinion is wrong, would you mind if I know why
1. the directory must sync per transaction?
2. PERSIST mode must close the journal file descriptor?
On UNIX, it's possible to delete a file from the file-system while
another process has it open. In this case the other process can continue
reading and writing its file-descriptor as normal, but the data is
stored in memory only, not on disk (since the directory entry has been
deleted). Once the process exits or closes the file-descriptor, the data
is lost.
This means that if a connection using "PRAGMA journal_mode = PERSIST"
keeps the journal file open while the database is unlocked (i.e. between
transactions), some other process using "PRAGMA journal_mode = DELETE"
might come along and delete the journal file while our "journal_mode =
PERSIST" process still has it open. In this case if the "journal_mode =
PERSIST" process then tries to execute another transaction and there is
a power failure halfway through, there will be no journal file on disk
following system recovery. Database corruption.
For this reason SQLite always closes the journal file at the end of a
transaction on UNIX. On windows, where it is not possible to delete a
file if another process has it open, SQLite holds the journal file open
between transactions.
Dan.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users