title: "Server failed to resume the transaction" error in SQL Server 2008 + .NET3.5 + LINQ
body: <p><strong>The aspx.cs Code:</strong>
  the code itself is pretty big, and the code here is fictional, but it looks (the important part) like this:</p>
  
  <pre><code>foreach (Transaction trans in vTransactionList)
          {
              switch (trans)
              {
                  case 201: codehere; break;
                  case 202: codehere; break;
                  case 203: 
                         vProcesso.MarcaEnvioServico(
                                      trans.ProcessId,
                                      trans.CodTrans);
                         break;
  
              }
          }     
  </code></pre>
  
  <p><strong>The business class Method:</strong></p>
  
  <pre><code>            RENDataContext db = new RENDataContext();
  
              Processo update = tabela.SingleOrDefault(
                  x =&gt; x.CodTrans == pCodTrans);
  
              update.SentDate= DateTime.Now;
              update.ProcessId = pProcessId;
              update.LogUsuario = pUsuario_Id;
              update.LogVersaoRegistro = servico.LogVersaoRegistro + 1;
              update.LogDataAlteracao = DateTime.Now;
  
              db.SubmitChanges();
  </code></pre>
  
  <p>Sometimes (very frequently I get this error (sqlserverexception) when executing this code: "The server failed to resume the transaction." Again, it's just random, sometimes it executes and sometimes it don't. When it fails first it keeps failing for some period of time.</p>
  
  <p><strong>I was using a stored procedure to update the table instead of that LINQ code, and the same problem happened.</strong></p>