Hi all,
I`m developing an application with several table inserts/updates with
relational data with. No problem. But I need your help about this:
Please look this code:
First query - father table:
<cfset CommitOK = true>
<cftransaction action="begin">
<cftry>
<cfloop collection="#form#" item="field">
<CFIF Left(field,14) IS 'StatusConfirms'>
<cfquery name="qryStatusFather"
datasource="#application.DSN#">
SET NOCOUNT ON
IF EXISTS
blablabla
</cfquery>
</CFIF>
</cfloop>
<cfcatch type="any">
<cfset CommitOK = false>
</cfcatch>
</cftry>
<cfif CommitOK>
bablabla
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Second query - child table:
<cfset CommitOK = true>
<cftransaction action="begin">
<cftry>
<cfloop from="1" to="#ListLen(IDStatus)#" index="i">
<cfquery name="qryChangeStatus" datasource="#application.DSN#">
UPDATE
StatusTable ...
<cfquery>
</cfloop>
<cfcatch type="any">
<cfset CommitOK = false>
</cfcatch>
</cftry>
blablabla
<cftransaction COMMIT OR ROLLBACK>
My question: how to isolate in only one transaction thats 2 statements with
unique cfloops? Using outside loop can degrade performance? Inside loops is
the best choice?
Thanx for your time.
Cheers
MD
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking
application. Start tracking and documenting hours spent on a project or with a
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:227794
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