Locking & SQL Server 7.0

James Cameron cameron at stl.dec.com
Wed Oct 24 19:08:29 EDT 2001


I can confirm that adding 'WITH (NOLOCK)' to apparently read-only PHP
applications using FreeTDS does indeed reduce the locking delays
experienced by updating stored procedures used by other users.

It's nothing to do with FreeTDS or PHP, it's just the way the server
works.

Brian Bruns wrote:
> If you do an exec sp_who while this blocking is happenning you'll see a
> number in the "blk" column.  Which will be the spid number of the
> blocking process (PHP).  Take that number and run an exec sp_lock <spid>
> and you'll see the lock that is causing the problem.  you can then take
> the object_id and run 'select object_name(<objid>)' to see the table,
> but you probably know this already.

I didn't know!  I guess many of us have entered the SQL arena with
insufficient knowledge.

Has anyone taken the sequence above and made a generalised PHP script
for it?  contention.php

-- 
James Cameron                                      (cameron at stl.dec.com)

http://www.opensource.org/ http://vanilla.us.netrek.org/ http://lwn.net/



More information about the FreeTDS mailing list