<xml></xml>

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

Berkeley DB .NET API Documentation
Transaction..::.Prepare Method
Transaction Class See Also

Initiate the beginning of a two-phase commit.

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

# Syntax

C#

    public void Prepare(
    	byte[] globalId
    )

Visual Basic (Declaration)

    Public Sub Prepare ( _
    	globalId As Byte() _
    )

Visual C++

    public:
    void Prepare(
    	array<unsigned char>^ globalId
    )

#### Parameters

globalId
  Type: array< System..::.Byte >[]()[]
  The global transaction ID by which this transaction will be known. This global transaction ID will be returned in calls to Recover(UInt32, Boolean) telling the application which global transactions must be resolved.

# Remarks

In a distributed transaction environment, Berkeley DB can be used as a local transaction manager. In this case, the distributed transaction manager must send prepare messages to each local manager. The local manager must then call Prepare and await its successful return before responding to the distributed transaction manager. Only after the distributed transaction manager receives successful responses from all of its prepare messages should it issue any commit messages.

In the case of nested transactions, preparing the parent causes all unresolved children of the parent transaction to be committed. Child transactions should never be explicitly prepared. Their fate will be resolved along with their parent's during global recovery.

# See Also

Transaction Class
BerkeleyDB Namespace