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 strValue parameter 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 ...

Get ASP in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.