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 Send Feedback

Flush any cached information to disk.

Namespace: BerkeleyDB
Assembly: libdb_dotnet181 (in libdb_dotnet181.dll) Version: 18.1.32.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 always succeeds.

Flushing cached information to disk only minimizes the window of opportunity for corrupted data. Although unlikely, it is possible for database corruption to occur in the event of a system or application crash 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 then replace the corrupted database with the updated copy once all applications using the database have successfully called Close()()().

# See Also

BaseDatabase Class
BerkeleyDB Namespace