We'll have the freedom to choose.
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/

