In the previous thread I started CFC & cftransaction I was able to find out
some useful information regarding cftransaction syntax. The thread kind of
got off track, and I would still love to know the answer to my underlying
questions, which are:
1.) Is there anything wrong with putting the cftransaction with try/catch in
the action page? (Assuming data source arguments are passed - Dave Watts
brought up this point) Putting the cftransaction on the action page does
work, and it does catch errors.
2.) I'm working in MySQL 4.1, so stored procedures are not an option. I
would like to wrap the cftransaction around the flushDiscountToDatabase()
methods so one cftransaction would handle a flush method for a parent
record, and looping over child record flush methods. So the question is
there anything inherently wrong with the following?
<cftransaction>
<cfset myObj.flushToDatabase(ArgumentCollection=formParams) />
<cfloop index="i" from="1" to="#somenum#">
<set childFormParams = ... />
<cfset myChildObj.flushChildToDatabase(ArgumentCollection=childFormParams)
/>
</cfloop>
</cftransaction>
The main reason I want to put cftransaction in the action page are because:
1.) You cannot nest cftransaction tags.
2.) I do not want to write the same queries more than once since I may want
to only update a parent or a single child record without having to update
the entire family.
I hope this all makes sense.
Thank you,
Aftershock Web Design, Inc.
by: Stan Winchester
President/Developer
http://www.aftershockweb.com/
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:232797
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54