zCommitXaction

Commits a transaction.

Service:File System Services (64-Bit)

Syntax

#include <zPublics.h>

STATUS zCommitXaction(
   Key_t   key,
   Xid_t   xid);

Parameters

key

(IN) Specifies the key that identifies the owner of the transactions. Although any key derived from the same root key can be used for this function, it is easier to maintain the code if you use the same key that was used in zBeginXaction.

xid

(IN) Specifies the transaction. All operations bound to the transaction are then permanent.

Return Values

zOK

The operation completed successfully.

non-0

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

Remarks

zCommitXaction does not return until all the operations bound to the transaction have been written to permanent storage. This does not mean the data has been written to the actual final fil. However, the data has been logged, so that if the system crashes, the recovery code can finish the operations. If this is a child of a nested transaction, all its locks are passed to its parent. If this is a root transaction, all of its locks are released before the call returns and after all the other operations have been committed.

See Also

zAbortXaction, zBeginXaction, zLockByteRange, zPrepareToCommitXaction, zUnlockByteRange