The reason you see a lot of code using cftransaction with try/catch is probably
because it comes straight from the ColdFusion MX Bible. They say if we don't
use BEGIN, COMMIT, and ROLLBACK then CFMX will slow to a crawl.
Putting the cftransaction with try/catch in the action page does work, and it
does catch errors; I just want to do something stupid. So you feel if I passed
the data source as an argument, then you would be okay?
I'm working in MySQL 4.1 now, so stored procedures are not an option, but would
be the better approach.
I can put the cftransaction in the cfc, but if I do an insert/update on a
parent record and N children then I may have to write the same queries more
than once since you cannot nest cftransaction tags. I may want to only update a
parent or a single child record without having to update the entire family. I
was thinking I should be able to do the following:
<cftransaction>
<cfset myDiscount.flushDiscountToDatabase(ArgumentCollection=formParams) />
<cfloop index="i" from="1" to="#somenum#">
<cfset myChildDiscount.flushChildDiscountToDatabase(i) />
</cfloop>
</cftransaction>
Thanks! Stan
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232400
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54