11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Caché</strong> <strong>ObjectScript</strong> CommandsDescriptionTCOMMIT marks the successful end of a transaction initiated by the corresponding TSTART.TCOMMIT decrements the value of the $TLEVEL special variable. <strong>Caché</strong> terminates thetransaction only if $TLEVEL goes to 0. Usually this is when TCOMMIT has been calledas many times as TSTART. Changes made during nested transactions are not committeduntil $TLEVEL=0.Calling TCOMMIT when $TLEVEL is already 0 results in a error. Thiscan occur if you issue a TCOMMIT when no transaction is in progress, when the numberof TCOMMIT commands is larger than the number of TSTART commands, or followinga TROLLBACK command.ArgumentspcAn optional postconditional expression. <strong>Caché</strong> executes the command if the postconditionalexpression is true (evaluates to a non-zero numeric value). <strong>Caché</strong> does not execute the commandif the postconditional expression is false (evaluates to zero). For further details, referto Command Postconditional Expressions in Using <strong>Caché</strong> <strong>ObjectScript</strong>.ExamplesYou use TCOMMIT with the TROLLBACK and TSTART commands. See TROLLBACKand TSTART for examples of how to use these transaction processing commands together.NotesNested TSTART / TCOMMIT<strong>Caché</strong> supports the nesting of the TSTART/TCOMMIT commands, so that modules canissue their TSTART/TCOMMIT pairs correctly, independent of any otherTSTART/TCOMMIT issued in the modules that called them or in the modules they call.The current nesting level of the transaction is tracked by the special variable $TLEVEL. Thetransaction is committed when the outermost matching TCOMMIT is issued; that is, when$TLEVEL goes back to 0.You can roll back individual nested transactions by calling TROLLBACK 1 or roll back allcurrent transactions by calling TROLLBACK. TROLLBACK rolls back the whole transactionthat is in effect — no matter how many levels of TSTART were issued — and sets$TLEVEL to 0.136 <strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!