How to disable Android SQLite Journal file?

Arvind picture Arvind · Apr 6, 2012 · Viewed 13.2k times · Source

I am using transactions to insert multiple rows into table. But, I still see temporary sqlite-journal file being created on SD Card along with sqlite table.

How do I disable creation of journal file?

Thanks

Answer

user610650 picture user610650 · Apr 6, 2012

You can elect to keep the journal in memory so that no -journal file is created:

pragma journal_mode=memory;

Note that you need to run this each time you open the database.

I recommend that you read the following to get a better idea of what is going on:

http://www.sqlite.org/pragma.html#pragma_journal_mode