MACROMEDIA COLFUSION MX 7-CFML Reference page 427

Cfml reference
Hide thumbs Also See for COLFUSION MX 7-CFML:
Table of Contents

Advertisement

Usage
If you do not specify a value for the
as follows:
If the
operations within the transaction block complete without an error, the
cfquery
transaction is committed.
If a
tag generates an error within a
cfquery
the transaction roll back.
If you do not specify a value for the
level for the associated database.
Using CFML error handling and the
whether a transaction is committed or rolled back, based on the success or failure of the database
query. Within a transaction block, you can do the following:
Commit a database transaction by nesting the
within the block
Roll back a transaction by nesting the
the block
(In these examples, the slash is alternate syntax that is the equivalent of an end tag.)
Within a transaction block, you can write queries to more than one database, but you must
commit or roll back a transaction to one database before writing a query to another.
To control how the database engine performs locking during the transaction, use the
attribute.
Example
<p>CFTRANSACTION can be used to group multiple queries that use CFQUERY
into one business event. Changes to data that is requested by the queries
are not committed to the datasource until all actions within the transaction
block have executed successfully.
<p>This a view-only example.
<!---
<cftransaction>
<cfquery name='makeNewCourse' datasource='Snippets'>
INSERT INTO Courses
(Number, Descript)
VALUES
('#myNumber#', '#myDescription#')
</cfquery>
<cfquery name='insertNewCourseToList' datasource='Snippets'>
INSERT INTO CourseList
(CorNumber, CorDesc, Dept_ID,
CorName, CorLevel, LastUpdate)
VALUES
('#myNumber#', '#myDescription#', '#myDepartment#',
'#myDescription#', '#myCorLevel#', #Now()#)
</cfquery>
</cftransaction>
--->
attribute, automatic transaction processing proceeds
action
cftransaction
attribute, ColdFusion uses the default isolation
isolation
attribute, however, you can also explicitly control
action
<cftransaction action = "commit"/>
<cftransaction action = "rollback"/>
block, all
operations in
cfquery
isolation
cftransaction
tag
tag within
427

Advertisement

Table of Contents
loading

This manual is also suitable for:

Colfusion mx 7 - installing and using coldfusion mx

Table of Contents