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.

You can issue a TROLLBACK 1 command to roll back the current level of nested transaction.You can issue a TROLLBACK to roll back the whole transaction, no matter how manylevels of TSTART were issued.You can use the $ZUTIL(78,21) function to search the journal file for TSTART commands,and thus identify open transactions. A TSTART writes either a “BT” (Begin Transaction)journal file record if $TLEVEL was zero, or a “BTL” (Begin Transaction with Level) journalfile record if $TLEVEL was greater than 0.The maximum number of levels of nested transactions is 255. Attempting to exceed thisnesting levels limit results in a error.SQL and Transactions<strong>Caché</strong> <strong>ObjectScript</strong> transaction processing, using TSTART and TCOMMIT, differs from,and is incompatible with, SQL transaction processing using the SQL statements STARTTRANSACTION and COMMIT. <strong>Caché</strong> <strong>ObjectScript</strong> transaction processing provides limitedsupport for nested transactions; SQL transaction processing does not support nested transactions.An application should use one type of transaction processing throughout, and not attemptto mix the two.ArgumentspcAn optional postconditional expression. <strong>Caché</strong> executes the TSTART command if the postconditionalexpression is true and does not execute the TSTART command if the postconditionalexpression is false. For further details, refer to Command Postconditional Expressionsin Using <strong>Caché</strong> <strong>ObjectScript</strong>.ExamplesTSTARTThe following example shows nested pairs of TSTART/TCOMMIT amd the effects ofTROLLBACK on nested transactions. Each TSTART increments $TLEVEL and sets a global.Issuing a TCOMMIT on the inner nested transaction decrements $TLEVEL, but the commitmentof changes made in a nested transaction is deferred. In this case, the subsequentTROLLBACK on the outer transaction rolls back all changes made, including those in theinner “committed” nested transaction.<strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong> 143

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

Saved successfully!

Ooh no, something went wrong!