Since you cannot nest transactions you have wrap 1 in an outer layer and
then call all your CFCs. I think the best way to do this is inside a
try/catch block. E.g.
<cftransaction action="begin">
<cftry>
<cfset doSomeDBStuff() />
<cfset doMoreDBStuff() />
<cfset doMasdBStuff() />
<!--- if you got here, then all is good. Go ahead and commit DB
transction --->
<cftransaction action="commit" />
<cfcatch>
<cftransaction action="rollback" />
<cfrethrow /> <!--- or whatever --->
</cfcatch>
</cftry>
</cftransaction>
This is what I do and it has proved to be a good approach. If someone has
another approach I would be interested in hearing about it!
/Cody
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Michael T. Tangorre
Sent: Thursday, March 16, 2006 11:26 AM
To: [email protected]
Subject: [CFCDev] CFCs DB Transactions
I have seen this issue pop up from time to time on this list and thought I
would inquire as to how people are handling this...
What are some of the options when it comes to using transactions,
committing, and rolling back when the pieces of the transaction come from a
variety of CFCs?
Thanks,
Tango.
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email to
[email protected] with the words 'unsubscribe cfcdev' as the subject of the
email.
CFCDev is run by CFCZone (www.cfczone.org) and supported by CFXHosting
(www.cfxhosting.com).
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]