The. DB-Wal file in the android text message database and contact data

Source: Internet
Author: User

Android 2.3 began to adopt SQLite 3.7, while SQLite 3.7 began to introduce Wal mode (write ahead log), a new transaction control mechanism,

So we will see the. DB-Wal file format in the System text message and contact database ,.

The purpose of the introduction is to ensure Database Consistency and avoid Database Consistency when the program crashes. So that's why

The 3rd-party program can read the contact data normally, but sometimes cannot read the data. In this case, it is best to restart the machine.

For detailed description of Wal file format, see: http://www.sqlite.org/fileformat2.html

It is mentioned that:

A Wal file consists of a header followed by zero or more "frames ". each frame records the revised content of a single page from the database file. all changes to the database are recorded by writing frames into the Wal. transactions commit when a frame is written that contains a commit marker. A single Wal can and usually does record multiple transactions. periodically, the content of the wal is transferred back into the database file in an operation called a "checkpoint ".

A single Wal file can be reused multiple times. in other words, the wal can fill up with frames and then be checkpointed and then new frames can overwrite the old ones. A Wal always grows from beginning toward the end. checksums and counters attached to each frame are used to determine which frames within the wal are valid and which are leftovers from prior checkpoints.

Related Article

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.