title: <nativehr>0x80070002</nativehr> in Sharepoint 2010
body: <p>I recently upgraded from Sharepoint 2007 to 2010.  I have a windows service that inserts pdfs into sharepoint. It works great on 2007.  When I migrated to 2010, I started getting the following intermittent error:</p>
  
  <pre><code>&lt;nativehr&gt;0x80070002&lt;/nativehr&gt;
  
  at Microsoft.SharePoint.Library.SPRequestInternalClass.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid&amp; pgListId, Int32&amp; plItemId, Int32&amp; plType, Object&amp; pvarFileOrFolder) at 
  
  Microsoft.SharePoint.Library.SPRequest.GetMetadataForUrl(String bstrUrl, Int32 METADATAFLAGS, Guid&amp; pgListId, Int32&amp; plItemId, Int32&amp; plType, Object&amp; pvarFileOrFolder) at Microsoft.SharePoint.SPWeb.GetList(String strUrl)
  </code></pre>
  
  <p>Here is the offending line of code:</p>
  
  <pre><code>SPList parentList = web.GetList(url);
  </code></pre>
  
  <p>What's weird, is that this only occasionally fails. I've actually wrapped this line of a loop, and if it it fails, I wait a bit, and then try to get the list again.  Usually after a few tries, the GetList will succeed.</p>
  
  <p>Since it's not easly duplicatable, I'm looking for any leads I might be able to track down.</p>
  
  <p>From google searches, the "recommend" fix is to change any .GetList(...) calls to SPWeb.Lists[".."];</p>
  
  <p>But, I got away from that, due to the perf hit on 2007 ( .GetList(...) has better perf than SPWeb.Lists["..."])</p>
  
  <p>Any suggestions?  </p>
  
  <p>Thanks!<br>
  Dave</p>