title: ReportServer database deadlock on dbo.DataSource table
body: <p>I get several deadlocks a day on the DataSource table with the stored procedures dbo.AddDataSource and dbo.GetDataSources.  They are page level locks.  Any ideas on how to alleviate the situation?</p>
  
  <p>XML Deadlock Graph:</p>
  
  <pre><code>&lt;deadlock&gt;   &lt;victim-list&gt;
      &lt;victimProcess id="process1d1df6548c8" /&gt;   &lt;/victim-list&gt;   &lt;process-list&gt;
      &lt;process id="process1d1df6548c8" taskpriority="0" logused="0" waitresource="PAGE: 5:1:11004 " waittime="2057" ownerId="7905394629" transactionname="SELECT" lasttranstarted="2019-01-03T09:58:26.103" XDES="0x1c61d053a40" lockMode="S" schedulerid="6" kpid="5472" status="suspended" spid="311" sbid="0" ecid="0" priority="0" trancount="0" lastbatchstarted="2019-01-03T09:58:26.103" lastbatchcompleted="2019-01-03T09:58:26.103" lastattention="1900-01-01T00:00:00.103" clientapp="Report Server" hostname="FMS-SQL2016" hostpid="14792" loginname="NT SERVICE\ReportServer" isolationlevel="read committed (2)" xactid="7905394629" currentdb="5" currentdbname="ReportServer" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056"&gt;
        &lt;executionStack&gt;
          &lt;frame procname="ReportServer.dbo.GetDataSources" line="8" stmtstart="200" stmtend="2868" sqlhandle="0x03000500394a6d31fe340400eea8000001000000000000000000000000000000000000000000000000000000"&gt;
  *password-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------    &lt;/frame&gt;
        &lt;/executionStack&gt;
        &lt;inputbuf&gt; Proc [Database Id = 5 Object Id = 829246009]   &lt;/inputbuf&gt;
      &lt;/process&gt;
      &lt;process id="process1c87b3a28c8" taskpriority="0" logused="1012" waitresource="PAGE: 5:1:245381 " waittime="2059" ownerId="7905394609" transactionname="user_transaction" lasttranstarted="2019-01-03T09:58:26.100" XDES="0x1cc631e4ee0" lockMode="IX" schedulerid="2" kpid="12924" status="suspended" spid="316" sbid="0" ecid="0" priority="0" trancount="2" lastbatchstarted="2019-01-03T09:58:26.107" lastbatchcompleted="2019-01-03T09:58:26.107" lastattention="1900-01-01T00:00:00.107" clientapp="Report Server" hostname="FMS-SQL2016" hostpid="14792" loginname="NT SERVICE\ReportServer" isolationlevel="read committed (2)" xactid="7905394609" currentdb="5" currentdbname="ReportServer" lockTimeout="4294967295" clientoption1="671088672" clientoption2="128056"&gt;
        &lt;executionStack&gt;
          &lt;frame procname="ReportServer.dbo.AddDataSource" line="56" stmtstart="3944" stmtend="5074" sqlhandle="0x0300050000267930fc340400eea8000001000000000000000000000000000000000000000000000000000000"&gt;
  *password----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------    &lt;/frame&gt;
        &lt;/executionStack&gt;
        &lt;inputbuf&gt; Proc [Database Id = 5 Object Id = 813245952]   &lt;/inputbuf&gt;
      &lt;/process&gt;   &lt;/process-list&gt;   &lt;resource-list&gt;
      &lt;pagelock fileid="1" pageid="11004" dbid="5" subresource="FULL" objectname="ReportServer.dbo.DataSource" id="lock1c4ef2b1700" mode="IX" associatedObjectId="72057594043301888"&gt;
        &lt;owner-list&gt;
          &lt;owner id="process1c87b3a28c8" mode="IX" /&gt;
        &lt;/owner-list&gt;
        &lt;waiter-list&gt;
          &lt;waiter id="process1d1df6548c8" mode="S" requestType="wait" /&gt;
        &lt;/waiter-list&gt;
      &lt;/pagelock&gt;
      &lt;pagelock fileid="1" pageid="245381" dbid="5" subresource="FULL" objectname="ReportServer.dbo.DataSource" id="lock1c4fcf6f780" mode="S" associatedObjectId="72057594043301888"&gt;
        &lt;owner-list&gt;
          &lt;owner id="process1d1df6548c8" mode="S" /&gt;
        &lt;/owner-list&gt;
        &lt;waiter-list&gt;
          &lt;waiter id="process1c87b3a28c8" mode="IX" requestType="wait" /&gt;
        &lt;/waiter-list&gt;
      &lt;/pagelock&gt;   &lt;/resource-list&gt; &lt;/deadlock&gt;`
  </code></pre>