> I can't test it myself to simulate the race condition, but I > definitely know that people have been talking about this > issue for a very long time. I can remember reading posts > about it going back for years, and in those cases, people had > tried CFTRANSACTION alone and it didn't make a difference. > When they added a named lock, the problem was resolved. So, > I'm not sure if the behavior is different between different > RDBMSs, or if the isolation level of the transaction makes > some difference, but there have definitely been cases in the > past where people did not get the desired result with > CFTRANSACTION alone. I've read of others having a similar > issue where inserting and then trying to select the last > inserted value within a CFTRANSACTION block would still > return the incorrect id if another thread had also performed > an insert at the same time.
This will depend on the isolation level of the transaction and the default concurrency control behavior of your database. > A quick Google search reveals this article by Simon, where he > seems to indicate that setting the isolation level to > "serializable" should work. Maybe that is the key. It would be > worth it to try that out before adding the named lock. You know > more about databases than I do Dave, does that sound like it > would make a difference? Yes, using SERIALIZABLE should prevent the problem you're describing. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ColdFusion 8 - Build next generation apps today, with easy PDF and Ajax features - download now http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288244 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

