Steve,

You have  <cftransaction action="commit" /> before cfcatch.

Move commit to after you done with error.
Here is some code that should work:

<cfcatch type="any">
  <cftransaction action = "rollback"/>
 <cfrethrow>
    <cfset commitIt = "No">
  </cfcatch>

</cftry>
</cftransaction> 

<cfif commitIt> 
 <cftransaction action="commit"/>
 
</cfif>

Hope that helps.

MT


Steve Milburn <[EMAIL PROTECTED]> wrote: Hi folks

Can anyone tell me what is wrong with the following code?  It is a 
snippet of code from a cfc I am working on.  The problem I am having if 
that if one of the queries inside the loop fails for whatever reason 
(ie, db constraint error), the previous inserts are not removed from the 
db.  Shouldn't the rollback in the cfcatch take care of that for me? 

Thanks


        
       
        
            
cfsqltype="cf_sql_varchar" type="in" />
            
variable="sequenceID" />
        
       
        
            
                insert into sequenceLookup (sequenceID, examID, 
placeInOrder) values (
                    
cfsqltype="cf_sql_bigint" />,
                    
cfsqltype="cf_sql_bigint" />,
                    
cfsqltype="cf_sql_bigint" />
                )
            
        
       
        
        
       
        
    
        
        
cfcatch.Detail />             
    
       
  
---
---




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:258424
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to