This thread brings up a question I've had before -- how do you encapsulate transactions well?
I have found that there are times I have, for instance, a method in a CFC that properly belongs in a transaction -- often calling a few "atomic" methods that interact with a database that get wrapped into a transaction. However, I then find there are times I want to call that method inside another block of code that should also be in a transaction -- when that happens I end up refactoring everything to get the transaction to make sense around the largest grouping that is necessary. As a result, I end up needing to know a lot about the implementation details to know there is a transaction being created somewhere down the chain of method calls. To overcome this I've tried things like having all my atomic actions outside of transactions, then build a separate CFC that does nothing but transaction wrappers around those methods. That seems to be the cleanest way around the problem -- but, even then I find times that I wish I wouldn't have to write a new method for every permutation of other methods that belong in transactions (and, again, it requires that I know a lot about implementation details rather than just learning the API). Sean, you say such nested transactions were "bugs" in your code -- but, I suspect at least some of those were due to people following good encapsulation rules (not knowing about the underlying implementation that used a transaction). Perhaps you (and anyone else with deep experience on this) could elaborate on how you dealt with those situations? > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Behalf Of Sean A Corfield > Sent: Thursday, June 17, 2004 8:21 AM > To: [EMAIL PROTECTED] > Subject: Re: [CFCDev] Nested cftransaction error in CFMX 6.1 > > > On Jun 17, 2004, at 7:01 AM, Timothy Ford wrote: > > Anyone ever get this error with nested transactions in 6.1? > > Yes, CFMX 6.1 now correctly detects attempts to create nested > transactions and disallows them. > > > They worked in 6.0. Anyone�know�of�a resolution? > > They didn't work but the condition was not detected either so it > silently misbehaved... It bit us in a couple of places when we upgraded > from 6.0 to 6.1 (about a year ago!) but it was good because the > 'nested' transactions were really bugs in our code. > > Sean A Corfield -- http://www.corfield.org/blog/ ---------------------------------------------------------- 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]
