Re: Phantom Inserts
Posted in 1995
Topics: General Discussion
In article <1995Feb27.145749.18654@dbsoftware.com> janco@dbsoftware.com (Jim Ancona) writes: >> [phantom insert scenario deleted] >How does HOLDLOCK help you in this situation? The first SELECT with >HOLDLOCK keeps a shared lock on the rows in the SELECT for the duration of >the transaction. That will prevent another transaction from updating or >deleting those rows, but I don't see how it will prevent the INSERT from >showing up in the second SELECT. Am I missing something? when i read the command reference entry for select i came to the same conclusion, but the system 10 sys admin guide pg. 13-11 indicates that the HOLDLOCK keyword will indeed block an attempted insert. my question: the guide indicates an insert will block whether the select acquires either a page lock (if no index exists on the search argument) or a table lock, is this actually the case, or do i need to insure that i do get a table lock (by including an unindexed column)? craig -- One should not have too many virtues. FW Nietzsche (paraphrased)