2

Web Application setup:

  • .Net Framework 4.5.2
  • SessionState Mode: SQLServer

I'd like to know how we can determine if the application got a session lock.

I tried using performance monitor but i don't know what are the performance counters needed and what exactly are the pointers that we can say that it's a session lock.

1 Answers1

0

You can use this query to know the blocked Session Information-

SELECT session_id,        
   status,
        DB_NAME(database_id) [Database],
        blocking_session_id,
        wait_type,
        wait_time,
        wait_resource 
FROM    sys.dm_exec_requests
WHERE   blocking_session_id <> 0
GO

And to know some text regarding it use the following query-

SELECT  A.Session_id,
        A.blocking_session_id,
        DB_NAME(B.database_id) [Database],
        C.text
FROM    sys.dm_exec_requests A
        LEFT JOIN sys.dm_exec_requests B ON A.blocking_session_id = B.session_id
        OUTER APPLY sys.dm_exec_sql_text(B.sql_handle) C
WHERE   A.blocking_session_id <> 0
Dev
  • 357
  • 2
  • 11