HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Is an X lock on an "application" a bad thing?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
thingbadapplicationlock

Problem

I am digging into sys.dm_tran_locks and have found a single, persistent X lock of resource_type = APPLICATION that looks odd. The database which on which the lock exists is rarely used. The resource_description tells me it's db_owner and the naming convention looks to be related to our replication processes.

I would like to know if this is normal behavior and nothing to worry about or if I need to dig deeper to remove the lock.

(We are experiencing a variety of intermittent performance issues on this server and have yet to determine why - I have no reason to think this is related, but I did want to mention it.)

EDIT - I would also like to know what a lock on APPLICATION is - the MSDN descriptions are vague to me...

Solution

These locks are created by a call to sp_getapplock.

It will only cause blocking for other processes that also call sp_getapplock and request the same lock resource.

You could poll sys.dm_os_waiting_tasks to see if anything is ever blocked waiting for this but any such blocking would probably be desirable anyway as presumably the whole point of taking the lock is precisely to ensure this mutual exclusion.

Context

StackExchange Database Administrators Q#21613, answer score: 2

Revisions (0)

No revisions yet.