> -----Original Message----- > From: Dave Watts [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, April 03, 2002 5:51 AM > To: CF-Talk > Subject: RE: CFtransaction crap > > > > I generally use cftry/cfcatch in conjunction with cftransaction. > > This allows you to roll back if errors are encountered. > > You really don't have to do this. That's one of the features that > CFTRANSACTION provides for you. If you have multiple queries > within a single > transaction, and any fails, all changes made by any other query within the > transaction are rolled back. > > I can understand why a lot of people do this, since the CF documentation > shows an example of this, but again, it's not necessary.
I actually do this because I often have some additional processing that takes place between the query statements. An example might be where I update a structure to contain a max ID that I retrieved for one of the inserts. If there is some other problem in other logic, cftransaction won't catch it. Another thing I might do is retry something once or twice if the error happens to be a db connection timeout. Helps avoid sending the "please retry" message back to the user. This requires me to catch the error type. David Schmidt ______________________________________________________________________ Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.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