views:

2369

answers:

1

I have a stored procedure on SQL Server 2005 doing a Serializable Transaction. Inside this transaction, it selects a table with rowlock. At the end of the procedure, after rollback/commit, it sets the transaction isolation level to Read Commited.

This procedure is running, different processes have concurrent access controlled by these constraints, but suddenly, after some time, some processes throw a Sql Exception:

The instance of the SQL Server Database Engine cannot obtain a LOCK resource at this time. Rerun your statement when there are fewer active users. Ask the database administrator to check the lock and memory configuration for this instance, or to check for long-running transactions.

This is not predictable, it can happen early, or after an hour.

What can I do to solve this problem?

+1  A: 

you have too many locks for your memory. increase ram or rewrite your queries to use fewer locks. serializable is a lock hog. do you really need it?

Mladen Prajdic
+1 Totally agree. Do you really need a Serializable Transaction?
Mitch Wheat
It's what enterprise manager does when saving table changes. Someone on the SQL Server team decided i need a serializalbe transisolation level.
Ian Boyd