Re: Phantom Inserts

From: Craig Denson <denson_at_sdd.hp.com>
Date: 28 Feb 1995 12:15:23 -0800
Message-ID: <3j008rINN5k_at_hpsdlge8.sdd.hp.com>


In article <1995Feb27.145749.18654_at_dbsoftware.com> janco_at_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)
Received on Tue Feb 28 1995 - 21:15:23 CET

Original text of this message