Name
TRANSACTION —
<%@
TRANSACTION=
strValue
%>
Synopsis
Instructs the web server to treat the entire script as a single transaction. If you set the script as requiring a transaction, the web server uses Microsoft Transaction Server to ensure that the entire script is processed as a single unit (or transaction) or not at all. Currently, only database manipulation is available in transactions.
Parameters
-
strValue The possible values for the
strValueparameter are as follows:-
Required Instructs the web server that the current script requires a transaction
-
Requires_New Instructs the web server that the current script requires a new transaction
-
Supported Instructs the web server not to start a transaction
-
Not_Supported Instructs the web server not to start a transaction
Example
<%@ TRANSACTION=Required%> ' This code instructs the web server to start a new ' transaction for the current script.
Notes
Note that the value for the TRANSACTION directive
is not a string. For this reason, you must use an underscore for
those values that contain a space (Requires_New
and Not_Supported). As discussed in Chapter 6, only a single script can be encapsulated in a
transaction. You must ensure that the TRANSACTION
directive is the first line in a transactional script. Otherwise, it
will result in an error. Finally, you cannot encapsulate the
GLOBAL.ASA code in a transaction.
If an error occurs in a script encapsulated in a transaction, Microsoft Transaction Server will roll back any actions that support ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access