Amy__

Hi,

I have loads of warning messages in the event log concerning too many instances of the SiteConfigReadOnlyFreeThreaded objects.

I do not manually instantiate these and have checked the code for manual context creation. I found minimal occurrences of "offending" code, though and these warnings are getting logged when hitting pages which do not even call this code.

Could anyone let me know which CS components may be calling this code and when, or offer any assistance on diagnosing this problem

Many thanks,

Amy



Re: Commerce Server 2007 SiteConfigReadOnly

Joseph Johnson

Amy,

This object is loaded internally when instantiating context objects when using the site agent and service agent patterns. If you aren't using either of these patterns and are in fact using the properties of CommerceContext.Current to access all other contexts, then I'm not sure what would be causing this.

I think the most common offenders are Order Management Context and Profile Management Context, but it's possible to instantiate the catalog context incorrectly as well. Again, these are the most common offenders, but there may be other objects which load this in the background.

This may or may not be a critical problem that you need to troubleshoot at this point. If your webservers seem to be chewing on a lot of memory or they are crashing often, then you need to address this.






Re: Commerce Server 2007 SiteConfigReadOnly

Vinayak Tadas - MSFT

Can you try removing the following from web.config of your site

<add name="CommerceDataWarehouseAuthenticationModule" ................. />

and see if it fixes your problem.





Re: Commerce Server 2007 SiteConfigReadOnly

Amy__

Thanks for the feedback. Joseph, I'll recheck our code base paying specific attention to CatalogContext..

Vinayak, I've removed the entire CS Authentication resource from the Commerce Server instance and have therefore removed both the CommerceAuthentication module AND the CommerceDataWarehouseAuthentication module. from "httpModules" in the web.config which does not seem to have resolved the problem.

Is there anything else I may be missing





Re: Commerce Server 2007 SiteConfigReadOnly

Amy__

Hi,

Not sure if anyone is monitoring this thread, but here's what we've found.

After applying registry settings mentioned in this forum entry: http://groups.google.co.za/group/microsoft.public.commerceserver.general/browse_thread/thread/b48bfc8479370e8c/09a065c533d89c02 lnk=st&q=The+Commerce+Server+runtime+has+detected+that+more+than++instances+of+the+SiteConfigReadOnlyFreeThreaded+object+have+b

.. we were at least pointed to the offending line/s of code. We need to search for addresses and orders and are creating Profile- and OrderManagementContexts to do this. Any idea if we can "search" for orders using members from CommerceContext.Current We're going to modify our code to minimise the number of these contexts created. Will keep everyone who is interested informed of progress..





Re: Commerce Server 2007 SiteConfigReadOnly

Joseph Johnson

Amy,

There are no presently available runtime APIs for searching profile information. It is possible to get a single user's order history, but there's no way to search through all of the orders in this fashion.

Most of the runtime APIs are designed to operate with respect to a single user (CommerceContext.Current.User), such that a customer on the site has no way of accessing the information of other customers on the site. By allowing a customer to search the profiles / orders system, you are potentially compromising the privacy of other users, which is a big reason why there are no runtime APIs for this functionality. As such, you *typically* only allow specific business users access to this information using the Customer and Order Manager.






Re: Commerce Server 2007 SiteConfigReadOnly

Colin Bowern

You should be able to cache the context objects at the application level using the HttpRuntime cache. That should keep the number of instances down to two for the appdomain.




Re: Commerce Server 2007 SiteConfigReadOnly

josko

Hi,

I'm having a problem in my CS production environment: Too many SiteConfigReadOnlyFreeThreaded are being created.

After some time I finally managed to reproduce the problem on development machine and the culprit seems to be the CommerceDataWarehouseAuthenticationModule as suggested by Vinayak  in the post above.

What do I need to do to use the CommerceDataWarehouseAuthenticationModule and not receive the warning

----------------------------------
Here is the EventLog info:

The Warning:

The Commerce Server runtime has detected that more than 12 instances of the SiteConfigReadOnlyFreeThreaded object have been created. Creating many SiteConfigReadOnlyFreeThreaded instances will negatively affect the performance of the site. Please refer to the Commerce Server documentation for the recommended use of the SiteConfigReadOnlyFreeThreaded object.

 

The error*:

Exception information:

    Exception type: CommerceException

    Exception message: The call to function 'InitializeAuthLib' in the dll 'C:\Program Files\Microsoft Commerce Server 2007\AuthObjHlpr.dll' failed (HRESULT=2147614729). This may indicate an issue with the product installation, or with the settings for the site. Please verify your settings.

 

Stack trace:     at Microsoft.CommerceServer.Runtime.CommerceDataWarehouseAuthenticationModule.SetupEncryptionSettings()

   at Microsoft.CommerceServer.Runtime.CommerceDataWarehouseAuthenticationModule.Init(HttpApplication appInstance)

   at System.Web.HttpApplication.InitModules()

   at System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers)

   at System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context)

   at System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context)

   at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)

 

 

*I updated the dev machine registry with two flags as recommended in another post:
Go to HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\COMMERCE SERVER 2007
Create a DWORD "ExcessiveUseWarnLevel" and set it low, like 5.  Default is 100
Create a second DWORD "ThrowExceptionOnExcessiveUse" set it to 1, Default is 0

Thanks,