I could use an opinion from you gurus out there..
Given a situation where you want to use a cftransaction block in a low level
module, there is a typical problem that comes up. In some cases, you may
want to call this function on it's own, and in others you may want to have
an "outer" transaction that calls it while doing other queries.
Are there any inherent problems to using this approach?
<cffunction name="myFunction" output="no" returnType="boolean">
<cfargument name="useTransaction"
required="no"
default="yes"
type="boolean">
<cfset var myReturnValue = false>
<cfif Arguments.useTransaction>
<cftransaction>
<cfset Arguments.useTransaction = false>
<!--- recursively calling myself --->
<cfinvoke method="myFunction"
argumentCollection="#Arguments#"
returnVariable="myReturnValue">
</cftransaction>
<cfelse>
<cfquery>
...
</cfquery>
<cfquery>
...
</cfquery>
<cfquery>
...
</cfquery>
<cfset myReturnValue = true>
</cfif>
<cfreturn myReturnValue>
</cffunction>
Thanks in advance for your input/advice...
- j.
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the word 'unsubscribe cfcdev'
in the message of the email.
CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).
An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]