Conanicut
2006-01-31 03:58:17 UTC
This Macromedia article
http://www.macromedia.com/devnet/coldfusion/articles/cftransaction.html does a
good job of explaining transactions, but I'm confused by the 3rd-to-last
paragraph, which begins by referencing a Macromedia tech note
http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_17000. The tech
note advises using CFLOCK inside CFTRANSACTION in the case of getting a newly
inserted ID number from a table. But the article says you don't need to do
this, and that the only way to be 100% sure of getting the correct ID number is
to specify a serializiable isolation level transaction in a CFTRANSACTION tag,
but says best practices discourage doing this! About using CFLOCK inside
CFTRANSACTION, as the tech note recommends, the article says: "This isn't
completely true because other applications that access the data will not obey
the lock, nor will any other queries that ColdFusion executes obey the lock
since they are not contained within the same named cflock." I don't understand
this -- it couldn't mean that other queries with the same named lock won't obey
the lock, could it? What would be the use of locks at all, then? How do people
handle the locking/transaction issue? Thanks.
http://www.macromedia.com/devnet/coldfusion/articles/cftransaction.html does a
good job of explaining transactions, but I'm confused by the 3rd-to-last
paragraph, which begins by referencing a Macromedia tech note
http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_17000. The tech
note advises using CFLOCK inside CFTRANSACTION in the case of getting a newly
inserted ID number from a table. But the article says you don't need to do
this, and that the only way to be 100% sure of getting the correct ID number is
to specify a serializiable isolation level transaction in a CFTRANSACTION tag,
but says best practices discourage doing this! About using CFLOCK inside
CFTRANSACTION, as the tech note recommends, the article says: "This isn't
completely true because other applications that access the data will not obey
the lock, nor will any other queries that ColdFusion executes obey the lock
since they are not contained within the same named cflock." I don't understand
this -- it couldn't mean that other queries with the same named lock won't obey
the lock, could it? What would be the use of locks at all, then? How do people
handle the locking/transaction issue? Thanks.