@TRANSACTION

You can use the @TRANSACTION directive to indicate that the script should be treated as a transaction. If a script is treated as a transaction, Component Services will create a transaction to coordinate the updating of resources.

Syntax

<%@ TRANSACTION = value %>

 

Parameters
Value
A string that indicates the type of transaction support. Possible values are:
Value Meaning
Required The script will initiate a transaction
Requires_New The script will initiate a transaction
Supported The script will not initiate a transaction
Not_Supported The script will not initiate a transaction

Remarks

If a script contains the @TRANSACTION directive, it must be the very first line in the .asp file, otherwise an error is generated. You must add the directive to each page that should be run under a transaction. The current transaction ends when the script finishes processing.

If the script containing the @TRANSACTION directive has been called by either the Server.Transfer or Server.Execute method, and the value is specified as Required the script will continue the transaction of the calling asp if the calling asp was transacted. If the calling asp was not transacted, the called asp will create a new transaction.

For example, the following two scripts would be considered one transaction.

ASP

<%@ TRANSACTION=Required %>
<%
  Server.Transfer("/asp/asp2.asp")
%>
ASP2
<%@ TRANSACTION=Required%>
<%
  Server.CreateObject("Mytransactedcomponent.Closeout")
%>
See Also

ObjectContext