home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / SetAbort_JScript.asp < prev    next >
Text File  |  1997-10-25  |  2KB  |  63 lines

  1. <%@ TRANSACTION=Required LANGUAGE="JScript" %>
  2.  
  3. <HTML>
  4.     <HEAD>
  5.         <TITLE>Forced Abort with a Transactional Web Page</TITLE>
  6.     </HEAD>
  7.  
  8.     <BODY BGCOLOR="White" topmargin="10" leftmargin="10">
  9.  
  10.  
  11.         <!-- Display Header -->
  12.  
  13.         <font size="4" face="Arial, Helvetica">
  14.         <b>Forced Abort with a Transactional Web Page</b></font><br>
  15.       
  16.         <hr size="1" color="#000000">
  17.  
  18.  
  19.         <!-- Brief Description blurb.  -->
  20.  
  21.         This is an example demonstrating a forced abort
  22.         within a Transacted Web Page.  When an abort occurs,
  23.         all transacted changes within this web page (Database Access,
  24.         MSMQ Message Transmission, etc.) will be rolled back to
  25.         their previous state -- guarenteeing data integrity.
  26.  
  27.  
  28.         <%
  29.             // Abort Transaction
  30.  
  31.             ObjectContext.SetAbort();
  32.         %>
  33.  
  34.     </BODY>
  35. </HTML>
  36.  
  37.  
  38. <% 
  39.     // The Transacted Script Commit Handler.  This function
  40.     // will be called if the transacted script commits.
  41.     // Note that in the example above, there is no way for the
  42.     // script not to abort.
  43.  
  44.     function OnTransactionCommit()
  45.     {
  46.         Response.Write ("<p><b>The Transaction just comitted</b>.");
  47.         Response.Write ("This message came from the ");
  48.         Response.Write ("OnTransactionCommit() event handler.");
  49.     }
  50.  
  51.  
  52.     // The Transacted Script Abort Handler.  This function
  53.     // will be called if the transacted script aborts
  54.     // Note that in the example above, there is no way for the
  55.     // script not to abort.
  56.  
  57.     function OnTransactionAbort()
  58.     {
  59.         Response.Write ("<p><b>The Transaction just aborted</b>."); 
  60.         Response.Write ("This message came from the ");
  61.         Response.Write ("OnTransactionAbort() event handler.");
  62.     }
  63. %>