Here is what I figured out:

If I put cftransaction first and don't explicitly roll back the transaction,
the roll back does not occur.

If I put CFTRY first, I don't need to explicitly roll back the transaction.

So I chose to put cfTry first, then cfTransaction.

Thanks everyone.

Andy

-----Original Message-----
From: Barney Boisvert [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 28, 2003 3:49 PM
To: CF-Talk
Subject: RE: <cftransaction> <cftry> order


The first one, so you can rollback the transaction in the CFCATCH block:

<cftransaction action="begin">
   <cftry>

   <cfquery>
   <cfquery>
   <cfquery>

   <!--- this is optional --->
   <cftransaction action="commit" />

   <cfcatch>
      <!--- something happened, roll it back --->
      <cftransaction action="rollback" />
   </cfcatch>
   </cftry>
</cftransaction>

---
Barney Boisvert, Senior Development Engineer
AudienceCentral (formerly PIER System, Inc.)
[EMAIL PROTECTED]
voice : 360.756.8080 x12
fax   : 360.647.5351

www.audiencecentral.com

> -----Original Message-----
> From: Andy Ousterhout [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, May 28, 2003 12:38 PM
> To: CF-Talk
> Subject: <cftransaction> <cftry> order
>
>
> Brain cramp....Which is best/correct:
>
> <cftransaction>
>     <cftry>
>
>     <cfcatch>
>
>     </cftry>
> </cftransaction>
>
> OR
>
> <cftry>
>     <cftransaction>
>
>     </cftransaction>
>
>     <cfcatch>
> </cftry>
>
>

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

Host with the leader in ColdFusion hosting. 
Voted #1 ColdFusion host by CF Developers. 
Offering shared and dedicated hosting options. 
www.cfxhosting.com/default.cfm?redirect=10481

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to