<%@ TRANSACTION=Required LANGUAGE="JScript" %> Forced Abort with a Transactional Web Page Forced Abort with a Transactional Web Page

This is an example demonstrating a forced abort within a Transacted Web Page. When an abort occurs, all transacted changes within this web page (Database Access, MSMQ Message Transmission, etc.) will be rolled back to their previous state -- guarenteeing data integrity. <% // Abort Transaction. ObjectContext.SetAbort(); %> <% // The Transacted Script Commit Handler. This function // will be called if the transacted script commits. // Note that in the example above, there is no way for the // script not to abort. function OnTransactionCommit() { Response.Write ("

The Transaction just comitted."); Response.Write ("This message came from the "); Response.Write ("OnTransactionCommit() event handler."); } // The Transacted Script Abort Handler. This function // will be called if the transacted script aborts // Note that in the example above, there is no way for the // script not to abort. function OnTransactionAbort() { Response.Write ("

The Transaction just aborted."); Response.Write ("This message came from the "); Response.Write ("OnTransactionAbort() event handler."); } %>