You are here: Re: can you tell me why this causes a deadlock? « MsSQL Server « IT news, forums, messages
Re: can you tell me why this causes a deadlock?

Posted by John Rivers on 02/05/06 00:17

if you want to do that
you need to ensure you obtain all the locks required for the whole
transaction in the first statement
for example:

Session 1:
BEGIN TRAN
insert into joe with (tablockx) (c1,c2) values (1,2)

Session 2:
BEGIN TRAN
insert into joe with (tablockx) (c1,c2) values (3,4)

Session 1:
select * from joe

Session 2:
select * from joe

deadlocks only occur when developers don't understand locking
and they can render a production system virtually unusable ...

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация