Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Writer block reader, reader block writer...

Author  Topic 

edcas
Starting Member

5 Posts

Posted - 2005-09-27 : 06:11:47
hi,

i've performed a test on 2 machines based on the topic above, but it doesn't seem like blocking each other... This is the context...

I've created a table call TEST_DEL i.e.
quote:
CREATE TABLE test_del
(v_id INT,
desc CHAR(3)
)


In machine 1, i'm login as USER 1 and try to insert a set of records into the table
quote:

Machine 1
~~~~
BEGIN
DECLARE @li_num int,
@li_start int

SET @li_num = 100000
SET @li_start = 1

WHILE @li_start < @li_num
BEGIN
INSERT INTO test_del VALUES (@li_start, 'zzz', 'xxx')

IF (@li_start > @li_num)
BREAK
ELSE
SET @li_start = @li_start + 1
CONTINUE

END
END





In machine 2, i login in as USER 2 to retrieve the records at the same time...
quote:

SELECT * FROM test_del



but, the system still allow me to retrieve the records at the same time... May i know when will "Writer block reader, reader block writer" occur and in what situation

Thanks in advance

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2005-09-27 : 06:41:17
Put the first code block in a TRANSACTION and then try....

------------------------
I think, therefore I am - Rene Descartes
Go to Top of Page
   

- Advertisement -