Why Android automatically generates a db-journal file when it calls the SQLite database

Source: Internet
Author: User

Database in order to better achieve the security of data, half will have a log file to facilitate the database in case of unexpected recovery operations. Although SQLite is a single-file database, but perfectly formed, it will have a corresponding security mechanism exists

This journal file is a temporary log file for SQLite, which is mainly used for sqlite transaction rollback mechanism, which is generated at the beginning of the transaction and deleted at the end of the transaction. When a program crashes or the system loses power, the file remains on disk so that the next time the program runs, the transaction is rolled back.

In Android mode, the journal file is permanently left on the disk and will not be automatically erased. If a transaction rollback does not occur then the size of the. db-journal file is 0, which avoids the overhead of generating and deleting journal files each time.

Therefore, it is better to back up two files at the same time for data backup.

Why Android automatically generates a db-journal file when it calls the SQLite database

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.