User Guide

426 Chapter 2: ColdFusion Tags
cftransaction
Description
For enterprise database management systems that support transaction processing, instructs the
database management system to treat multiple database operations as a single transaction.
Provides database commit and rollback processing. See the documentation for your database
management system to determine whether it supports SQL transaction processing.
Category
Database manipulation tags
Syntax
<cftransaction
action = "begin" or "commit" or "rollback"
isolation = "read_uncommitted" or "read_committed" or
"repeatable_read" >
</cftransaction>
See also
cfinsert
, cfprocparam, cfprocresult, cfquery, cfqueryparam, cfstoredproc, cfupdate;
“Commits, rollbacks, and transactions” in Chapter 19, “Introduction to Databases and SQL,” in
ColdFusion MX Developer’s Guide
Attributes
Attribute Req/Opt Default Description
action Optional begin begin: the start of the block of code to execute.
commit: commits a pending transaction.
rollback: rolls back a pending transaction.
isolation Optional ODBC lock type:
read_uncommitted: reads without regard for other transactions
that are taking place. Sometimes called a ‘dirty read’ because
data that is read can be in a transitional state and therefore not
accurate.
read_committed: uses shared locks to assure that no other
transaction modifies rows that this transaction uses.
repeatable_read: same as read_committed, except that rows in
the recordset are exclusively locked until the transaction
completes. Due to high overhead, Macromedia does not
recommend this isolation level for normal database access.
serializable: places an exclusive lock on every data table in use
for the duration of the transaction. Causes access to the
database to be single-threaded and is therefore not
recommended for normal database access.