SharePoint: Exception from HRESULT: 0x80020009 (DISP_E_EXCEPTION)

I had a really strange error yesterday – when altering some pre-existing sharepoint code to ensure that spcontext.current.web.parentweb objects were disposed of correctly, I encountered the above error. Previously the code reinstantiated SPWeb objects from SPContext.Current.Web.ParentWeb.Url, rather than just using SPContext,Current.Web.ParentWeb directly and disposing. Note that I have never had any problem with this before, but in the above case, further objects were being obtained from SPContext.

This is the closest article relating to this issue:, however, in the code I am working on,  all spweb and spsite objects were disposed as expected.

My current suspicion, from looking at the SharePoint logs, is that somewhere in the stack, before or after the code I altered, an object is not disposed of correctly – I have not yet located this. The error in the logs is:

10/28/2008 15:58:34.11 w3wp.exe (0x10D8) 0x0E30 Windows SharePoint Services General 0 Medium Potentially excessive number of SPRequest objects (12) currently unreleased on thread 6. Ensure that this object or its parent (such as an SPWeb or SPSite) is being properly disposed. Allocation Id for this object: {6BEFDD45-D359-48FD-AA0A-624B4C2CB21F} Stack trace of current allocation: at Microsoft.SharePoint.SPRequestManager.Add(SPRequest request, Boolean shareable) at Microsoft.SharePoint.SPGlobal.CreateSPRequestAndSetIdentity(Boolean bNotGlobalAdminCode, String strUrl, Boolean bNotAddToContext, Byte[] UserToken, String userName, Boolean bIgnoreTokenTimeout, Boolean bAsAnonymous) at Microsoft.SharePoint.SPWeb.InitializeSPRequest() at Microsoft.SharePoint.SPWeb.EnsureSPRequest() at Microsoft.SharePoint.SPWeb.get_Request() at Microsoft.SharePoint.SPWeb.InitWebPub…

If anyone has any suggestions, I would be grateful! I will update this article when I resolve properly and definitively.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>