AlexVPerl
AlexVPerl

Reputation: 8026

Close to 3000 locks in SQL Server database

After running exec sp_lock on one of our databases we found there's close to 3000 locks present, however we're able to access and write to all tables.

We're using NHibernate in our app layer. Is this normal?

Upvotes: 1

Views: 159

Answers (2)

Eric Bonnot
Eric Bonnot

Reputation: 2054

Real problems come from "deadlocks" which you can track using "SQL Profiler". This article seems clear to let you configure SQL Profiler to find them.

Upvotes: 0

Lex
Lex

Reputation: 891

Most databases have some locks on them, most of them you do not have to worry about.

Locks often are used to prevent data corruption and invalid data by not allowing multiple users to modify the same data at the same time.

There are different types of locks, most of the time optimistic locks are used, which are only activated when a user actually updates the data.

Upvotes: 2

Related Questions