A long winded question about Transactions - - the Question is embedded in the code 
below...

<-cfset commitIt = True>
<-cftransaction action="BEGIN">
<-cftry>

        Database Inserts Go Here --

        If Var=X I want to terminate this .cfm page without closing the transaction 
and continuing with the calling cfm page which cfincludes another cfm to finish the 
database Inserts and close the transaction. 

However this errors with: Must include cfcatch inside a cftry block. Seems the cfcatch 
must be just above the cftry outside of any nested logic blocks.

<-cfif NOT Var=X>
  <-cfcatch type="Any">
        <-cftransaction action="ROLLBACK"/>
        <-cfset commitIt = False>
        <-cfinclude template="../catcherror.cfm">
  <-/cfcatch>
  <-/cftry>
  <-cfif commitIt>
        <-cftransaction action="COMMIT"/>
  <-/cfif>
  <-/cftransaction>
<-/cfif>

What are others doing to work across multiple pages in a runtime determined order.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
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

Reply via email to