In my way of thinking, transactions are a pure business logic "thing", they have nothing to do with persistance (though that's where they're actually implemented). If you accept that as valid, then there is never a need to deal with transactions anywhere except in your business logic components, so you won't run into the problem.
You will need to expose a means for starting, committing and rolling back a transaction to your business components from your persistence components. However, the persistance components' other methods shouldn't be aware that they exist, they're only there for the use of the business logic components. busnessLogic.cfc: function myMethod() { persister.startTransaction(); persister.updateItem(); persister.updateOtherItem(); var i = persister.checkThing(); if (NOT i) { persister.rollbackTransaction(); } else { persister.updateFinalItem(); persister.commitTransaction(); } } > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Behalf Of Jay Gibb > Sent: Tuesday, November 18, 2003 10:42 AM > To: [EMAIL PROTECTED] > Subject: [CFCDev] cftransactions in low level modules > > > 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] ---------------------------------------------------------- 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]