Skip to Main Content
Programming ColdFusion MX, 2nd Edition
book

Programming ColdFusion MX, 2nd Edition

by Rob Brooks-Bilson
August 2003
Intermediate to advanced content levelIntermediate to advanced
1140 pages
68h 45m
English
O'Reilly Media, Inc.
Content preview from Programming ColdFusion MX, 2nd Edition

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. Commit commits a pending transaction, and Rollback rolls 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, and Serializable.

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.
Start your free trial

You might also like

Programming ColdFusion

Programming ColdFusion

Rob Brooks-Bilson

Publisher Resources

ISBN: 0596003803Supplemental ContentErrata Page