Transactions in ASP
Transactions are often very helpful for database manipulation. They allow an all-or-none approach – if something, anything, fails then have the whole process fail rather than just part of it. This can ensure proper data manipulation – you won’t get half modified rows.
Well, you can do transactions with active server pages too. Just add the directive:
<%@ TRANSACTION = value %>
to the top of your ASP page, and voila! Transactions the easy way, without involving Microsoft Transaction Server (MTS). “value” can be one of the following:
- required
- The script will use a transaction, and will participate in any open transaction or create a new one if none are open.
- requires_new
- The script will always start a new transaction.
- supported
- The script will use any open transaction but will not start a new one if none are currently open.
- not_supported
- The script will neither initiate nor participate in a transaction.
