I've used CFTransaction across multiple includes and it seems to work well. Whether there is any performance hit, or if it's a good practice, I don't know.
But you shouldn't span TRY/Catch statements like that. For general/spanning error catching, use the CFError tags in your Application.cfm. Use Try/Catch for very specific errors. You shouldn't wrap large blocks of code in Try/Catch statements. Use them in a more localized manner where you need to catch very specific potential errors. Try/Catch is intended to give your application a way to fail gracefully, not catch every error that might occur. Not every line of code you write should be wrapped in a Try/Catch -- only those small portions that need the extra, specific type of error handling. CFerror handles everything else. At least -- IMHO. H. > -----Original Message----- > From: Greg McDaniel [SMTP:[EMAIL PROTECTED]] > Sent: Friday, January 03, 2003 7:54 AM > To: CF-Talk > Subject: cftry cftransaction across multiple includes > > I have several insert query statements that are CFIncluded as separate > files > inside a single CFCase statement. > cfcase. > cfinclude = "qry_insert1.cfm". > cfinclude = "qry_insert2.cfm". > cfinclude = "qry_insert3.cfm". > cfinclude = "qry_insert4.cfm". > /cfcase. > > Can I put "cftry" and "cftransaction begin" in the first include > and put the end tags /cftry /cftransaction in the last include? > > Would anyone have a way to manage multiple inserts such that they all > rollback if anyone of them fails? Is the above the wrong approach? > > Greg M > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

