Thanks Dave! Actually, I use the TRY/CATCH to send me an email when
something goes wrong, so I need at least one. I did not realize that
CFTRANSACTION would rollback on it's own... All docs seem to place the
CFTRANSACTION around a CFTRY, then place the ROLLBACK inside a CFCATCH. So I
guess that one TRY/CATCH should be sufficient...
Once again, learn something (lots of things) daily on this list! 

Thanks again!

Marwan

-----Original Message-----
From: Dave Watts [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 10, 2001 12:31 PM
To: CF-Talk
Subject: RE: 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-
> circuit the rest of the transaction, or does processing stop 
> automatically? 

You're doing more work than necessary, I think.

One of the purposes of using CFTRANSACTION in the first place is to roll
back any changes made if part of the transaction fails. You don't need the
CFTRY/CFCATCH in there - if you have a database error, the CFTRANSACTION
will roll back everything, then fail. You also don't need an explicit
ACTION="ROLLBACK" in there, unless you want to do a partial rollback, then
continue processing queries within the transaction.

Dave Watts, CTO, Fig Leaf Software


**********************************************************************
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/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to