Close SPSite and SPWeb when using the MOSS Object Model


Ensure that sites and webs are closed by calling their close method whenever you complete OM operations against MOSS.  Otherwise, you may see MOSS log the following:

Potentially excessive number of SPRequest objects (number) created on thread number. 

Once done with all the objects that hang off the SPSite or SPWeb, close them.

 

Here is a great link sent to me by a colleague describing the issue:

http://msdn2.microsoft.com/en-us/library/ms778813.aspx

Skip to main content