|
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">
|
- [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

