zPrepareToCommitXaction

Prepares the system to commit a transaction.

Service:File System Services (64-Bit)

Syntax

#include <zPublics.h>

STATUS zPrepareToCommitXaction(
   Key_t   key,
   Xid_t   xid);

Parameters

key

(IN) Specifies the owner of the transaction being prepared for commit. Alhough any key derived from the same root key can be used for this operation, it is easier to maintain the code if you use the same key that was used in zBeginXaction.

xid

(IN) Specifies the transaction to prepare so that it can be committed or aborted if requested.

Return Values

zOK

The operation completed successfully.

non-0

An error occurred (see Section 4.1, Return Values for a description).

Remarks

zPrepareToCommitXaction is similar to zCommitXaction, except it can still be aborted and is needed only to coordinate multiple transactions. In the simplest case, a transaction coordinator tells all the transactions it is coordinating to prepare. After every transaction has responded, they can all be committed.

See Also

zAbortXaction, zBeginXaction, zCommitXaction