Udostępnij za pośrednictwem


SQLiteDatabase.SyncModeNormal Field

Definition

The NORMAL sync mode, the SQLite database engine will still sync at the most critical moments, but less often than in FULL mode.

[Android.Runtime.Register("SYNC_MODE_NORMAL", ApiSince=33)]
public const string SyncModeNormal;
[<Android.Runtime.Register("SYNC_MODE_NORMAL", ApiSince=33)>]
val mutable SyncModeNormal : string

Field Value

Attributes

Remarks

The NORMAL sync mode, the SQLite database engine will still sync at the most critical moments, but less often than in FULL mode. There is a very small chance that a power failure at the wrong time could corrupt the database in DELETE journal mode on an older filesystem.

WAL journal mode is safe from corruption with NORMAL sync mode, and probably DELETE sync mode is safe too on modern filesystems. WAL mode is always consistent with NORMAL sync mode, but WAL mode does lose durability. A transaction committed in WAL mode with NORMAL might roll back following a power loss or system crash. Transactions are durable across application crashes regardless of the synchronous setting or journal mode.

The NORMAL sync mode is a good choice for most applications running in WAL mode.

Caveat: Even though this sync mode is safe Be careful when using NORMAL sync mode when dealing with data dependencies between multiple databases, unless those databases use the same durability or are somehow synced, there could be corruption.

See here for more details.

Java documentation for android.database.sqlite.SQLiteDatabase.SYNC_MODE_NORMAL.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to