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

  1. <%@ TRANSACTION=Required LANGUAGE="JScript" %>
  2.  
  3. <HTML>
  4.     <HEAD>
  5.         <TITLE>Syntax Error Abort within 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>Syntax Error Abort within 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 how a runtime error (that will
  22.         stop the execution of the ASP page), will force an abort
  23.         within the Transacted Web Page.  When an abort occurs,
  24.         all transacted changes within this web page (Database,
  25.         MSMQ Message Transmission, etc.) will be rolled back to
  26.         their previous state -- guarenteeing data integrity.
  27.  
  28.  
  29.         <%
  30.             // Syntax Error that will produce abort
  31.  
  32.             blah.blah();
  33.         %>
  34.  
  35.     </BODY>
  36. </HTML>
  37.  
  38.  
  39. <% 
  40.     // The Transacted Script Commit Handler.  This function
  41.     // will be called if the transacted script commits.
  42.     // Note that in the example above, there is no way for the
  43.     // script not to abort.
  44.  
  45.     function OnTransactionCommit()
  46.     {
  47.         Response.Write ("<p><b>The Transaction just comitted</b>.");
  48.         Response.Write ("This message came from the ");
  49.         Response.Write ("OnTransactionCommit() event handler.");
  50.     }
  51.  
  52.  
  53.     // The Transacted Script Abort Handler.  This function
  54.     // will be called if the transacted script aborts
  55.     // Note that in the example above, there is no way for the
  56.     // script not to abort.
  57.  
  58.     function OnTransactionAbort()
  59.     {
  60.         Response.Write ("<p><b>The Transaction just aborted</b>."); 
  61.         Response.Write ("This message came from the ");
  62.         Response.Write ("OnTransactionAbort() event handler.");
  63.     }
  64. %>