FairCom Corporation


F.1 Abort


Abort the current transaction in progress.

SHORT NAME

TRANABT

TYPE

Low-level function

DECLARATION

COUNT Abort()

DESCRIPTION

Abort aborts the current transaction. All file update actions since the last Begin will not be committed. All known locks are released, and the transaction ends.

RETURN

Value
Symbolic Constant
Explanation
0
NO_ERROR
No error occured.
71
TNON_ERR
There is no active transaction pending.

See Appendix A "c-tree Plus Error Codes" of the c-tree Plus Programmer's Reference Guide for a complete listing of valid c-tree Plus error values.

EXAMPLE

COUNT savepoint;
void domaster() {
Begin(ctENABLE|ctTRNLOG); /* start transaction with locks */
while(another()); { /* get next record to add */
savepoint = SetSavePoint(); /* get save point at
beginning of each master record */
if (add_master() < 0)
Abort(); /* abort if can't add master rec */
dodetail(); /* process detail records */
}
if (Commit(ctFREE)0)
printf("\nError %d in transaction",uerr_cod);
return;
}
void dodetail() {
while(moredetail()); { /*get next detail record to add */
if (add_detail()<0) { /* add details, if possible */
RestoreSavePoint(savepoint)
/* with error, return to savept */
return;
}
}
}

SEE ALSO

Begin, Commit, RestoreSavePoint, SetSavePoint, and ClearTranError.


FairCom Corporation
www.faircom.com