FairCom Corporation


4.3.15 ctdbBegin


Start a transaction.

Declaration

CTDBRET ctdbBegin(CTHANDLE Handle)

Description

ctdbBegin marks the beginning of a transaction. All files updates done after this call will be held until they are committed with a matching call to ctdbCommit. Notice that the record locks still must be acquired with a call to ctdbLockRecord. If for any reason the transaction cannot be committed, it can be finished with a call to ctdbAbort. This function can be used to perform transaction-controlled file creates.

Returns

ctdbBegin returns CTDBRET_OK if successful, or the c-tree Plus error code on failure.

Example

ctdbBegin(pSession);
if (ctdbCreateTable(tHandle1,"table1",CTCREATE_NORMAL) == CTDBRET_OK)
ctdbCommit(pSession);
else
ctdbAbort(pSession);

See also

ctdbCommit, ctdbAbort, HYPERLINK \l "ctdbIsTransActive" ctdbIsTransActive, ctdbLockRecord.


FairCom Corporation
www.faircom.com