11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Caché</strong> <strong>ObjectScript</strong> CommandsTROLLBACKRolls back an unsuccessful transaction.TROLLBACK:pcTRO:pcTROLLBACK:pc 1TRO:pc 1Argumentspc1Optional — A postconditional expression.Optional — Rolls back one level of nesting.DescriptionTROLLBACK terminates the current transaction and restores all journaled database valuesto the values they held at the start of the transaction. TROLLBACK has two forms:• TROLLBACK rolls back all transactions in progress (no matter how many levels ofTSTART were issued) and resets $TLEVEL to 0.• TROLLBACK 1 rolls back the current level of nested transactions (the one initiated bythe most recent TSTART) and decrements $TLEVEL by 1.You can determine the level of nested transactions from the $TLEVEL special variable.Calling TROLLBACK when $TLEVEL is 0 has no effect.You can use the $ZUTIL(78,21) function to search the journal file for TSTART commands,and thus identify open transactions. A TSTART increments $TLEVEL and writes a journalfile record: either a “BT” (Begin Transaction) record if $TLEVEL was zero, or a “BTL”(Begin Transaction with Level) record if $TLEVEL was greater than 0.Use the $ZUTIL(78,29) function to flush the journal buffer following a successful rollbackoperation.Transaction Rollback LoggingIf an error occurs during a roll back operation, <strong>Caché</strong> issues a error message,and logs an error message in the operator console log file.By default, the operator console log file is cconsole.log in the <strong>Caché</strong> system managementdirectory (Mgr). This default is configurable. Go to the System Management Portal, select138 <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!