[thelist] ColdFusion CFTRANSACTION

Raymond Camden jedimaster at macromedia.com
Mon Jun 25 09:58:11 CDT 2001


The last piece of code must be a cfcatch block. You can have comments
between the closing cfcatch and cftry, but no code.

I'd recode it like so:

notes - first, you don't need a cfcatch after each include. If the cfinclude
for q_fileN causes an error, none of the other guys will work, so, one
"final" cfcatch is enough.

 <cftry>
	<cftransaction>
  	<cfinclude template="q_file1.cfm">
 	<cfinclude template="q_file2.cfm">
 	<cfinclude template="q_file3.cfm">
 	<cfinclude template="q_file4.cfm">
	</cftransaction>
	<cfcatch type="Any"><cftransaction action="ROLLBACK" /></cfcatch>
 </cftry>

This _should_ work well for you. Note - "should." I'm a bit unsure about
this.

=======================================================================
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia

Email   : jedimaster at macromedia.com
ICQ UIN : 3679482

"My ally is the Force, and a powerful ally it is." - Yoda

> -----Original Message-----
> From: thelist-admin at lists.evolt.org
> [mailto:thelist-admin at lists.evolt.org]On Behalf Of jon steele
> Sent: Saturday, June 23, 2001 6:29 PM
> To: TheList Evolt
> Subject: [thelist] ColdFusion CFTRANSACTION
>
>
> Is this correct usage of CFTRANSACTION? I get a "Last tag in cftry must
> be cfcatch", but in the documentation, in the example, the last tag
> their is cftransaction...so I'm confused. Also, do I need any
> <cftransaction action="commit"> tags? What I basically need is either
> all pages are run with no errors or none are run.
>
> <cftry>
> <cftransaction>





More information about the thelist mailing list