title: SQL Server cannot obtain a LOCK resource at this time - What to do?
body: <p>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.</p>
  
  <p>This procedure is running, different processes have concurrent access controlled by these constraints, but suddenly, after some time, some processes throw a Sql Exception:</p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <p>This is not predictable, it can happen early, or after an hour.</p>
  
  <p>What can I do to solve this problem?</p>