In general, it is not really a good idea to nest transactions. It doesn't make much logical sense. The whole point of a transaction is that if one part fails, the whole thing fails and is rolled back. If you have a nested transaction that fails and is rolled back, what state is the outer transaction in? Does the transaction commit or is it rolled back as well? Logically, it should also fail and be rolled back since part of it (nested transaction) failed.
If you find yourself wanting nested transactions, you might want to reconsider the way you are interacting with the database and redesign your queries. Paul Kenney [EMAIL PROTECTED] 916-212-4359 > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Behalf Of Kevin Long > Sent: Thursday, June 17, 2004 7:24 AM > To: [EMAIL PROTECTED] > Subject: Re: [CFCDev] Nested cftransaction error in CFMX 6.1 > > > Tim, > > >From my understanding, it was a bug in 6.0 that allowed there to be > nested transactions. Really the only actions that belong insinde a > transaction is a commit or a rollback. > > Having said that, I had this problem with some code I was working with > that might include code that was inside a transaction of its own. > > Very basic example of what we ended up doing follows: > > <cfif NOT request.transaction_open> > <cftransaction> > <cfset request.transaction_open = true> > <cfinclude template= "code that was in its own > transaction"> > </cftransaction> > <cfset request.transaction_open = false> > <cfelse> > <!--- This is being called from inside an existing > transaction ---> > <cfinclude template= "code that was in its own transaction"> > </cfif> > > Hope it helps. > > -Kevin > > > ----- Original Message ----- > From: Timothy Ford <[EMAIL PROTECTED]> > Date: Thu, 17 Jun 2004 10:01:05 -0400 > Subject: [CFCDev] Nested cftransaction error in CFMX 6.1 > To: [EMAIL PROTECTED] > > > > > > > > > > > > Anyone ever get this error with nested transactions in > 6.1? > > > > > > > > > > > > > Nested > transactions are not supported. > > You cannot nest a > cftransaction tag within another cftransaction tag. Check for a > cftransaction tag on the page that called the CFC. > > > > They worked in 6.0. > Anyone know of a resolution? > > > > Thanks > > Tim > ---------------------------------------------------------- > You are subscribed to cfcdev. To unsubscribe, send an email > to [EMAIL PROTECTED] with the words '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 words '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]
