Name
cftransaction
Synopsis
<cftransaction>
CFML code
</cftransaction>
Treats all
query operations between
<cftransaction>...</cftransaction>
tags as a single transaction. Changes to the database
aren’t committed until all queries in the
transaction have executed successfully. In the event that a query
within the transaction fails, all previous queries are automatically
rolled back.
cftransaction tags may be nested to allow portions
of the transaction to be committed or rolled back within the main
cftransaction block. More than one database may be
written to within a single cftransaction block if
each transaction is committed or rolled back prior to writing a query
to the next database. Exception handling using
cftry/cfcatch gives you full
control over how queries are committed and rolled back within
cftransaction blocks.
Attributes
-
action="begin|commit|rollback" The action to take. Optional. The default value is
Begin, which specifies the beginning of a block of code to execute as a transaction.Commitcommits a pending transaction, andRollbackrolls back a pending transaction.-
isolation="ODBC_lock_type" The ODBC lock type to use for the transaction. The following ODBC lock types are supported:
Read_Uncommitted,Read_Committed,Repeatable_Read, andSerializable.