home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_06.cab / samp46ic.asp < prev    next >
Text File  |  1997-10-15  |  3KB  |  42 lines

  1.  <% If Request("DontFrame")<>1 Then Response.Redirect "/iissamples/sdk/asp/docs/SampFram.asp?ovfile=/iishelp/iis/htm/sdk/samp46ic.asp&srcfile=Transactional/SetAbort" %>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  3. <HTML>
  4. <HEAD>
  5. <META HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
  6. <title>Forced Abort</title>
  7. <script language="JavaScript">
  8.  
  9.     szNavVersion = navigator.appVersion
  10.  
  11.     if (navigator.appName == "Microsoft Internet Explorer") {
  12.     if (szNavVersion.indexOf ("4.") >= 0) {
  13.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
  14.     } else {
  15.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
  16.     }
  17.     }
  18.     else if (navigator.appName == "Netscape") {
  19.     document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
  20.     }
  21.     else {
  22.     document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
  23.     }
  24.  
  25. </script>
  26. <META NAME="DESCRIPTION" CONTENT="Internet Information Server reference information"></HEAD>
  27. <BODY BGCOLOR=#FFFFFF TEXT=#000000>
  28. <font face="Verdana, Arial, Helvetica">
  29. <h3><a name="_forced_abort"></a>Forced Abort</h3>
  30. <p>
  31. ASP makes it easy for you to gain the reliability provided by MTS services. You only need to include the @TRANSACTION directive in your script. This directive tells MTS that any changes that occur in that page, such as database manipulation and MSMQ message transmission, should be considered transactions. A change that is being managed by transaction services can be either committed, making it more or less permanent, or aborted, which would result in the state of the database or queue being rolled back to before the changes were made.</p>
  32. <p>
  33. In this sample, the entire page has been declared a transaction, as just described. The sample then provides some scripting commands for two other procedures that are called to perform additional completion or clean-up tasks. <b>OnTransactionCommit </b>is called when either the script has successfully completed, or the <b>ObjectContext.SetComplete</b> method has been called. Likewise, <b>OnTransactionAbort</b> is called when the script either encounters some kind of processing error, or the <b>ObjectContext.SetAbort</b> method has been called. </p>
  34. <p>
  35. This sample aborts automatically by calling the <b>ObjectContext.SetAbort</b> method. Since the directive declared the script to be a transaction, aborting automatically rolls back changes made in the script, of which there are none, and triggers the <b>OnTransactionAbort</b> procedure, which prints a message.</p>
  36. <p>
  37. <b>Note</b>  The @TRANSACTION directive must be on the first line of the .asp file, or an error will be generated.</p>
  38. <hr class="iis" size="1">
  39. <p align="center"><em><a href="/iishelp/common/colegal.htm">© 1997 by Microsoft Corporation. All rights reserved.</a></em></p>
  40. </BODY>
  41. </HTML>
  42.