On 07/11/2016 11:18 AM, 刘翔 wrote:
Dear SQLite developers,
Sqlite version: 3.8.8.3
Linux version: 3.10.31-ltsi
Question:
We found when updated a sqlite database in emmc disk, it cannot remove
journal file as soon as the transaction finished.
We know after the transaction finishes, SQLite will unlink the journal
file.
But when we update a database and shut down in about 2~3s, the journal
file still exists after system startups.
It seems unlink() file would not remove it immediately, until kernel
call sync() to flush disk.
So, does this correspond to SQLite's design? Or could you give me some
suggestion how to remove the journal file quickly.
With version 3.11.0 or greater, either building with
-DSQLITE_EXTRA_DURABLE or execute "PRAGMA synchronous=EXTRA" after
connecting to the database causes SQLite to sync the directory after
deleting the rollback journal.
With older versions, using "PRAGMA journal_mode=PERSIST" or "PRAGMA
journal_mode=TRUNCATE" provides the same level of durability.
Dan.
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users