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
BTreeDatabase..::.Compact Method (CompactConfig)
BTreeDatabase Class See Also

Compact the database, and optionally return unused database pages to the underlying filesystem.

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

# Syntax

C#
    public CompactData Compact(
    	CompactConfig cdata
    )

Visual Basic (Declaration)
    Public Function Compact ( _
    	cdata As CompactConfig _
    ) As CompactData

Visual C++
    public:
    CompactData^ Compact(
    	CompactConfig^ cdata
    )

#### Parameters

cdata
  Type: BerkeleyDB..::.CompactConfig
  Compact configuration parameters

#### Return Value

Compact operation statistics

# Remarks

If the operation occurs in a transactional database, the operation will be implicitly transaction protected using multiple transactions. These transactions will be periodically committed to avoid locking large sections of the tree. Any deadlocks encountered cause the compaction operation to be retried from the point of the last transaction commit.

# See Also

BTreeDatabase Class
Compact Overload
BerkeleyDB Namespace