First, you can't put CFCATCH tags in the middle of a CFTRY. I has to be the
last tag in the CFTRY.
I would do need to do this:
<cfset dataproblem=0>
<cftransaction action="BEGIN">
<cftry>
... queries ...
<cfcatch type="database">
<cftransaction action="ROLLBACK"/>
<cfset dataproblem=1>
</cfcatch>
</cftry>
<cfif dataproblem EQ 0>
<cftransaction action="COMMIT"/>
</cfif>
</cftransaction>
Hope this helps
-----Original Message-----
From: Saidi; Marwan [mailto:[EMAIL PROTECTED]]
Sent: 10 August 2001 15:55
To: CF-Talk
Subject: CFTRY/CFCATCH question
I have a template with a multi-part update (several tables). I have the
entire process wrapped in <cftransaction> and <cftry>. After each individual
update, I have a <cfcatch>. My question is if something fails, and I
<cftransaction action=rollback />, do I need to short-circut the rest of the
transaction, or does processing stop automatically?
I.E.:
<cfset dataproblem=0>
<cftransaction action=begin isolation=serializable>
<cftry>
<cfquery ....>
Update table1
</cfquery>
<cfcatch type=database>
<cfset dataproblem=1>
<cftransaction action=rollback />
</cfcatch>
======> Do I need to short circuit here? (<cfif dataproblem IS "0">)
<cfquery ....>
Update table2
</cfquery>
Thanks,
Marwan Saidi
Webmaster
CED - Concord IS
[EMAIL PROTECTED]
407.741.8645
**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
This footnote also confirms that this email message has been swept by
MIMEsweeper for the presence of computer viruses.
www.mimesweeper.com
**********************************************************************
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
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