I went ahead and implemented as I described. I didn’t add the isolation level.  If you need that then you can turn off transactions and use your own cftransaction tag.

 

50/50 that this will be committed tonight.

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Paul Kenney
Sent: Tuesday, April 25, 2006 5:19 PM
To: [email protected]
Subject: Re: [Reactor For CF] Transactions...

 

In that case, I might also suggest that an additional argument could be isolation level for the new transaction... or set it as a property of the Record object. But that might be asking too much :)

On 4/25/06, Chris Phillips <[EMAIL PROTECTED]> wrote:

I like that!
We'll have the freedom to choose.

 

On 4/25/06, Doug Hughes <[EMAIL PROTECTED]> wrote:

Paul,

 

I think I'm going to be removing transactions from the DAOs altogether.  I'll be adding them into the load / save / delete methods of records.  A new, optional, attribute will be added to these methods to indicate if the methods should use a transaction or not.  For example:

 

<!--- implicitly use transactions to save --->

<cfset user.save() />

 

<!--- explicitly use transactions --->

<cfset user.save(useTransaction=true) />

 

<!--- explicitly don't use transactions --->

<cfset user.save(useTransaction=false) />

 

So, let's say your user hasOne address.  You load a user and update it and its address.  By calling user.save() the entire thing would be executed in a transaction.  All of the child saves would have useTransaction set to false.

 

You could also wrap the save in a transaction tag and pass in useTransaction=false.  This would allow you to run more than one saves of not-necessarily-related objects in one transaction.

 

This should be simple to implement.  I might just do this tonight. 

 

There's a 50/50 chance I'll be checking in the validation updates tonight too.

 

Doug

 





--
Chris Phillips
www.dealerpeak.com
Senior Application Developer -- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/




--
Paul Kenney
[EMAIL PROTECTED]
http://www.pjk.us -- 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/

Reply via email to