title: how do I fix SqlException Time-out occurred while waiting for buffer latch type 2 for page (1:37660679), database ID 10
body: <p>I was running an application for a few hours and then suddenly:</p>
  
  <p>SqlException was unhandled by user code:</p>
  
  <blockquote>
    <p>Time-out occurred while waiting for buffer latch type 2 for page
    (1:37660679), database ID 10.</p>
  </blockquote>
  
  <p>Viewing details of the exception shows it is a "Number" "845". ErrorCode and HRESULT -2146232060</p>
  
  <p>Question: How do I fix this or debug this problem?</p>
  
  <ul>
  <li><p>I am running ASP.NET C# .NET 4.5 and SQL Server 2012.</p></li>
  <li><p>I ran chkdsk but did not find any errors.</p></li>
  </ul>
  
  <p>There is nothing about an 845 event in the log. Here is some of what I found in the application log(For an event-id 847): </p>
  
  <blockquote>
    <p>Timeout occurred while waiting for latch: class 'FGCB_ADD_REMOVE', id
    00000004F146FBD8, type 2, Task 0x00000004F60450C8 : 0, waittime 300
    seconds, flags 0x1a, owning task 0x00000004EDC38928. Continuing to
    wait.</p>
  </blockquote>
  
  <p>There are lots of 847 that look about the same. Then there are much fewer with event-id 846: </p>
  
  <blockquote>
    <p>A time-out occurred while waiting for buffer latch -- type 2, bp
    00000004F96EE880, page 1:37660679, stat 0x10b, database id: 10,
    allocation unit Id: 72057594048544768, task 0x00000004D502E188 : 0,
    waittime 300 seconds, flags 0x1a, owning task 0x00000004D5316558. Not
    continuing to wait.</p>
  </blockquote>
  
  <p>Here is an xml view of an 847 event:</p>
  
  <pre><code>- &lt;Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"&gt;
  - &lt;System&gt;
    &lt;Provider Name="MSSQLSERVER" /&gt; 
    &lt;EventID Qualifiers="16384"&gt;847&lt;/EventID&gt; 
    &lt;Level&gt;4&lt;/Level&gt; 
    &lt;Task&gt;2&lt;/Task&gt; 
    &lt;Keywords&gt;0x80000000000000&lt;/Keywords&gt; 
    &lt;TimeCreated SystemTime="2013-02-24T19:21:54.000000000Z" /&gt; 
    &lt;EventRecordID&gt;281870&lt;/EventRecordID&gt; 
    &lt;Channel&gt;Application&lt;/Channel&gt; 
    &lt;Computer&gt;xyz-PC&lt;/Computer&gt; 
    &lt;Security UserID="S-1-and-so-on" /&gt; 
    &lt;/System&gt;
  - &lt;EventData&gt;
    &lt;Data&gt;FGCB_ADD_REMOVE&lt;/Data&gt; 
    &lt;Data&gt;00000004F146FBD8&lt;/Data&gt; 
    &lt;Data&gt;2&lt;/Data&gt; 
    &lt;Data&gt;00000004D5316188&lt;/Data&gt; 
    &lt;Data&gt;0&lt;/Data&gt; 
    &lt;Data&gt;1200&lt;/Data&gt; 
    &lt;Data&gt;1a&lt;/Data&gt; 
    &lt;Data&gt;00000004EDC38928&lt;/Data&gt; 
    &lt;Binary&gt;4F0300000A00000006000000540053002D005000430000000800000053006300680061006200650072000000&lt;/Binary&gt; 
    &lt;/EventData&gt;
    &lt;/Event&gt;
  </code></pre>
  
  <p>The error occurred on a line</p>
  
  <pre><code>  db.SubmitChanges();
  </code></pre>
  
  <p>In the watch window I can see:</p>
  
  <pre><code>db.GetChangeSet() {Inserts: 1, Deletes: 0, Updates: 0} System.Data.Linq.ChangeSet
  </code></pre>
  
  <p>Googling shows up some hotfixes from microsoft but they are only for SQL server 2008.</p>