Barry,

But that is what I am doing, did I not say that in my first email?


<cftry>
 ...more logic removed
 <cftransaction>
 <cfloop index="Count" from="1" to="3">
  ..more logic removed
  <cfset InsertData(stufftoinsert) />
 </cfloop>
 </cftransaction>
</cftry>
<cfcatch>
</cfcatch>

I was well aware of not doing the old, commit, begin and rollback and wasn't
even needing any advice on that!!

Gosh, I wish people would actually read emails!!

 
Regards
Andrew Scott
Technical Consultant

NuSphere Pty Ltd
Level 2/33 Bank Street
South Melbourne, Victoria, 3205

Phone: 03 9686 0485  -  Fax: 03 9699 7976


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Barry Beattie
Sent: Thursday, 29 July 2004 1:38 PM
To: CFAussie Mailing List
Subject: [cfaussie] RE: CFTransaction and CFC's

>> the point is that I use the cftransaction because there is a loop of 
>> 3 inserts and if one fails they all need to fail

from a thread I started on cfczone.org

http://www.mail-archive.com/[EMAIL PROTECTED]/msg05876.html

<snip>

> Dave, I noticed (in a houseoffusion post) you shy away from try/catch 
> within a transaction. how come?

It's usually not necessary, especially within the commonly used example that
is posted over and over again, in which an exception is thrown and caught
within the CFTRANSACTION. If you have multiple queries using the same
database connection within a CFTRANSACTION, and one of them fails, there's
no need to catch that failure and issue a rollback, as the CFTRANSACTION tag
will do that for you

</snip>

hope that helps
barry.b



---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to