|
Hi,
I just want to say that I have run into the same kind of
"issue". Dealing with composite objects, I was not able to enclose my multiple
save's in <cftransaction> tags..
I'd really welcome any change to this.
Your suggestions look good from my point of
view.
Regards,
Tormod Boga
Inbusiness AS
Fra: Doug Hughes [mailto:[EMAIL PROTECTED] Sendt: 25. april 2006 13:18 Til: [email protected] Emne: RE: [Reactor For CF] Transactions... Paul –
First off, it looks
like your method names are backwards. IE save has transactions while vs.
saveWithTransaction does not. I do like your
suggestion. I’ve been thinking about transactions for this very
reason. I see a few options
which I will freeform below: 1)
Transactions are the
developers problem. In this case I’d remove it from the framework
altogether and leave it in the developers court to
handle. 2)
Transactions are moved
into the record and can be optionally disabled. This is essentially what
you’ve suggested. I’d do the same thing (I think) for loads and deletes
too. However, rather than having two methods I’d probably have one method
that you could pass an argument into. IE: <cffunction
name="save" returntype="void" access="public"> <cfargument
name=”useTransactions” default=”true />
<cfif arguments.useTransactions>
<cftransaction>
<cfset beforeSave()> <cfset
_getDAO().save(...)>
<cfset afterSave()>
</cftransaction> <cfelse>
<cfset beforeSave()> <cfset
_getDAO().save(...)>
<cfset afterSave()> </cfif> </cffunction> That said,
I’m not sure how that’d word with saves/deletes very cleanly, but we’ll
see. Any other
thoughts? Doug From:
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Kenney A while ago, I tried wrapping a call to a
XyzRecord's save() method inside a <cftransaction> tag, and discovered
that transactions already a part of the framework. After looking at how the
transactions are being used, I found that they are placed inside the DAOs in the
save() method. A long time ago I learned that a transaction is really a
"business-level" concept that encompass all the tables/records needed to persist
a single object and all its dependencies. With that in mind, it makes more sense
for me to have transactions live in the XyzRecord object, outside of the DAOs
used by the XyzRecord object. <cffunction name="save" returntype="void"
access="public">
__________ NOD32 1.1505 (20060425) Information __________ This message was checked by NOD32 antivirus system. http://www.eset.com -- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/ -- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/ |
- [Reactor For CF] Transactions... Paul Kenney
- RE: [Reactor For CF] Transactions... Doug Hughes
- SV: [Reactor For CF] Transactions... Tormod Boga
- Re: [Reactor For CF] Transactions... Paul Kenney
- RE: [Reactor For CF] Transactions... Doug Hughes
- Re: [Reactor For CF] Transactions... Chris Phillips
- Re: [Reactor For CF] Transactions... Paul Kenney
- RE: [Reactor For CF] Transact... Doug Hughes
- Re: [Reactor For CF] Transact... Paul Kenney
- Re: [Reactor For CF] Transact... Brian Kotek
- RE: [Reactor For CF] Transact... Doug Hughes
- Re: [Reactor For CF] Transactions... Daryl

