Used to specify the database synchronization mode when writing to disk.
Class
TLiteConnectionOptions
Syntax
property Synchronous: TSynchronous default DefValSynchronous;
Remarks
Use the Synchronous property to specify the database synchronization mode when writing to disk.
-
smExtra
- This mode is similar to the FULL mode, but in the DELETE mode, the directory containing the rollback journal is synced after that journal is unlinked to commit a transaction. This provides additional durability if a power outage occurs right after the commit.
-
smFull
- The database engine ensures that all content is safely written to disk before continuing. This preserves database integrity even in case of an operating system failure or power outage. It is a safe, but slower mode, and is most commonly used when not in the WAL mode.
-
smNormal
- The database engine still syncs at the most critical moments, but less often than in the FULL mode. The Normal mode is faster than the Full mode. When using the WAL mode (and probably the DELETE mode) with synchronous=NORMAL, data is safe from corruption. The synchronous=NORMAL setting is a reasonable choice for most applications running in the WAL mode.
-
smOff
- The database engine continues without syncing after handing data off to the operating system. If the application running SQLite crashes, the data will safe, unless the operating system crashes or the computer loses power before data has been written to disk, in which case the database might become corrupted. This is the fastest mode.
Note:
Keep the default Synchronous=smOff and LockingMode=lmExclusive for the best perfomance.
See Also