Hello,
I hope someone can help me here.
I am a dba, not a developer. We need to identify a problem with a blocking lock. I have try using profiler to capture blocking and also use master..sysprocesses to identify a blocking process.
However, all I see are SELECT statement blockiing another SELECT statement. As we all know SELECT statement does not block another SELECT statement.
To test this, I create a simple scenario:
In session # 1:
--create table and populate with data select 1 as id, 'Jan' as name into employee --update the table without committing begin transaction update employee set name='Jin' where id=1 --see the updated employee while still uncommitted select * from employee
Now go to another sesssion
--session # 2
select * from employee
Now seesion 1 and blocking session 2. However, in profiler blocking report, it showed that SELECT * from employee is blocking SELECT * from Employee, but the real problem is UPDATE is blocking SELECT.
Assuming that I don't know anything about this transaction, how to I find out what the real blocking lock.
Here is the blocking report from profiler:
<blocked-process-report><blocked-process>
<process id="process4bcae08" taskpriority="0" logused="0" waitresource="RID: 8:1:103775:0" waittime="5543" ownerId="670327" transactionname="SELECT" lasttranstarted="2012-10-02T11:15:35.397" XDES="0x80035920" lockMode="S" schedulerid="2" kpid="3500" status="suspended" spid="58" sbid="0" ecid="0" priority="0" trancount="0" lastbatchstarted="2012-10-02T11:15:35.397" lastbatchcompleted="2012-10-02T11:15:26.697" clientapp="Microsoft SQL Server Management Studio - Query" hostname="4_TEST" hostpid="5964" loginname="domain\chao" isolationlevel="read committed (2)" xactid="670327" currentdb="8" lockTimeout="4294967295" clientoption1="671090784" clientoption2="390200">
<executionStack>
<frame line="1" sqlhandle="0x02000000b65d8e2dbd659adf5f93b5202725d362763c43c3"/>
</executionStack>
<inputbuf>
select * from employee </inputbuf>
</process>
</blocked-process>
<blocking-process>
<process status="sleeping" spid="62" sbid="0" ecid="0" priority="0" trancount="1" lastbatchstarted="2012-10-02T11:15:22.883" lastbatchcompleted="2012-10-02T11:15:22.883" clientapp="Microsoft SQL Server Management Studio - Query" hostname="4_TEST" hostpid="5964" loginname="domain\chao" isolationlevel="read committed (2)" xactid="667145" currentdb="8" lockTimeout="4294967295" clientoption1="671090784" clientoption2="390200">
<executionStack/>
<inputbuf>
select *
from employee </inputbuf>
</process>
</blocking-process>
</blocked-process-report>
Thank you for any assistance!