Sync Method

Collapse All Expand All Code: All Code: Multiple Code: C# Code: Visual Basic Code: Visual C++

C#
Visual Basic
Visual C++

Berkeley DB .NET API Documentation
BaseDatabase..::.Sync Method
BaseDatabase Class See Also

Flush any cached information to disk.

Namespace: BerkeleyDB
Assembly: libdb_dotnet48 (in libdb_dotnet48.dll) Version: 4.8.24.0

# Syntax

C#
    public void Sync()

Visual Basic (Declaration)
    Public Sub Sync

Visual C++
    public:
    void Sync()

# Remarks

If the database is in memory only, Sync has no effect and will always succeed.

It is important to understand that flushing cached information to disk only minimizes the window of opportunity for corrupted data. Although unlikely, it is possible for database corruption to happen if a system or application crash occurs while writing data to the database. To ensure that database corruption never occurs, applications must either: use transactions and logging with automatic recovery or edit a copy of the database, and once all applications using the database have successfully called Close()()(), atomically replace the original database with the updated copy.

# See Also

BaseDatabase Class
BerkeleyDB Namespace