This is not a very good example of how to employ CFTRANSACTION, it does not show how to use the various actions.. Its pretty much a shot in the dark unless you get the livedocs for CF5 (which is more detailed) but following the code there is invalid because cftry requires the last tag executed within itself be cfcatch.. so the method of catching and setting a variable in that method doesn't work.. This is how you need to do it..
<Cfset gotrue=1> <cftransaction> <cftry>...queries here... <cfcatch>...catch the error... <cfset gotrue=0> <cftransaction action="rollback"> <cfrethrow> <!---This line throws the error back to your error handler if you have one.. If you don't, you can remove this...---> </cfcatch> </cftry> <cfif gotrue eq 1> ...do something... <cftransaction action="commit"> </cfif> </cftransaction>
Livedocs really needs to improve this page, very badly...
You may also notice that I posted this same comment on the livedocs page. I'm severely disappointed in Macromedia on the documentation of that page.