Brian Kotek wrote:
> 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

It is.

> or if the isolation level of the transaction makes some difference

It does.


> 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.

Semantics: the database always correctly returns the last inserted ID. 
The objective of preventing another thread from inserting another ID 
between the insertion and the select in the thread with cftransaction 
just wasn't met.


> A quick Google search reveals this article by Simon, where he seems to
> indicate that setting the isolation level to "serializable" should work.

For the last inserted ID issue it should.

Jochem

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade to ColdFusion 8 and integrate with Adobe Flex
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:288258
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to