You need to change how the try works with transaction...
<CFTRANSACTION>
<CFTRY>
<!--- Queries Here --->
<CFTRANSACTION ACTION="COMMIT"/>
<CFCATCH>
<!--- We have experienced an error...
Rollback the inserts and set the
commit flag
to false for processing later
--->
<CFTRANSACTION ACTION="ROLLBACK"/>
<!--- Failed to insert all the information into
the database --->
INSERT FAILED :(
<CFABORT>
</CFCATCH>
</CFTRY>
</CFTRANSACTION>
HTH
Mike
-----Original Message-----
From: Chad Gray [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 25, 2001 15:20
To: CF-Talk
Subject: CFTRANSACTION error in CF example
There is an error in the example code that comes with the CFStudio help
file for CFTRANSACTION. I get this error: Context validation error in
tag
CFTRY The tag is not correctly positioned relative to other tags in the
template: the last tag nested inside tag CFTRY must be a CFCATCH tag.
Currently it is a CFTRANSACTION tag. The error occurred while processing
an
element with a general identifier of (CFTRY), occupying document
position
(27:1) to (27:7). How would i fix the code so it works right?
CFTRANSACTION Example
CFTRANSACTION can be used to group multiple queries using CFQUERY into a
single business event. Changes to data requested by these queries can be
committed on the basis of the success or failure of the query by using
the
actions COMMIT and ROLLBACK, respectively.
The following is a sample listing (see code in right pane): INSERT
INTO Courses (Number, Descript) VALUES ('#myNumber#',
'#myDescription#') INSERT INTO CourseList (CorNumber,
CorDesc,
Dept_ID, CorName, CorLevel, LastUpdate) VALUES ('#myNumber#',
'#myDescription#', '#myDepartment#', '#myDescription#', '#myCorLevel#',
#Now()#)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists