Geeks With Blogs
Amusingly MOSS ...It's funny how difficult some stuff is when it really shouldn't be

I've been troublshooting some Application Log issues for a client today, and found multiple instances of Commerce Server error 4116, which all message that goes something like this:

The Commerce Server runtime has detected that more than # 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.

After a quick google search for "SiteConfigReadOnlyFree", I came across Tom Shultz's Blog which clearly identified that the warnings were coming from one of two places:

  1. Your site is configured to use the CommerceDataWarehouseAuthenticationModule (in which case, this problem was resolved in SP1, so it really shouldn't be this problem, seeing how SP2 has been out for a long time now)
  2. You're creating new instances of Commerce System Context objects, each of which create new SiteConfigReadOnlyFree in memory.  This happened to be the case for us.

The correct practice here is to only use the CommerceContext.Current object (as opposed to creating new ones each time), and this will avoid creating new SiteConfigReadOnlyFree objects over and over in memory.

Posted on Wednesday, September 16, 2009 10:05 AM Commerce Server | Back to top


Comments on this post: Correcting the Multiple SiteConfigReadOnlyFree Instances Warning in Commerce Server

# re: Correcting the Multiple SiteConfigReadOnlyFree Instances Warning in Commerce Server
Requesting Gravatar...
Hello,
We built a WCF service and for each call CommerceContext.Current is null. Each time CommerceContext.Current is null, we create a new one as below:

ProfileContext oProfileSystem = null;
if (null == CommerceContext.Current)
oProfileSystem = new ProfileContext(Constants.ProfileConnectionString, new ConsoleDebugContext(DebugMode.Checked));
else
oProfileSystem = CommerceContext.Current.ProfileSystem;

Profile userProfile = oProfileSystem.GetProfile(UserLoginPropertyName, userid, UserProfileName);

On doing this, we are seeing warnings in the event logs about SiteConfigReadOnlyFreeThreaded and too many profile contexts getting created.

Any recommendations?

Thanks
Left by Naga on Jan 30, 2014 9:00 AM

# re: Correcting the Multiple SiteConfigReadOnlyFree Instances Warning in Commerce Server
Requesting Gravatar...
Check out a related question and answer I came up with on StackOverflow -

http://stackoverflow.com/questions/1441098/commerce-server-how-to-get-the-pagegroup-without-instancing-a-new-marketingc

Hope that helps!
Left by Adam McKee on Jan 30, 2014 9:52 AM

Your comment:
 (will show your gravatar)


Copyright © Adam McKee | Powered by: GeeksWithBlogs.net