on 2013 Oct 27 5:56 PM
Yesterday was the first anniversary of this unanswered question. It still applies, to Version 16 as well as 12... if one was impolite, one might ask "What is the point of CONNECTION_PROPERTY ( 'LockCount' ) if it returns zero for a connection that is holding a schema lock that is actually blocking another connection?" 🙂
Here is a query run in 12.0.1.3298 that shows one schema lock exists but DB_PROPERTY ( 'LockCount' ) returns zero. The same is true for CONNECTION_PROPERTY ( 'LockCount' ).
select DB_PROPERTY ( 'LockCount' ), * from sa_locks(); DB_PROPERTY('LockCount'),conn_name,conn_id,user_id,table_type,creator,table_name,index_id,lock_class,lock_duration,lock_type,row_identifier '0','OLTP1_update',12,'DBA','BASE','DBA','t',,'Schema','Transaction','Shared',
If there are a million locks, will the following workaround be optimized or will it be slowwwwww?
SELECT COUNT(*) FROM sa_locks(); COUNT() 1
User | Count |
---|---|
68 | |
10 | |
10 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.