If I have a block of code that is going to call several queries, and I have placed the queries into functions of a CFC, can I wrap these calls into a single transaction?

 

Basically I will have something like this.

 

<!--- Update several related tables --->

<cftransaction>

<cfinvoke component="#dataObj#" method="updateTable1" ..>

 

<cfinvoke component="#dataObj#" method="deleteTable2" .>

<cfloop from="1" to="#something# index="i">

<cfif this EQ that>

<cfinvoke component="#dataObj#" method="insertTable2" .>

<cfelse>

<cfinvoke component="#dataObj#" method="updateTable2" .>

</cfif>

</cfloop>

</cftransaction>

 

Will the <cftransaction> work here allowing all these queries to be rolled back if any where to fail?

--------------
Ian Skinner
Web Programmer
BloodSource
www.BloodSource.org
Sacramento, CA

"C code. C code run. Run code run. Please!"
- Cynthia Dunning

 

Confidentiality Notice: This message including any attachments is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender and delete any copies of this message.

Reply via email to