FIX: Empty HttpContext.Current.User.Identity.Name value in unnecessary SQL queries to the Profiles database in Commerce Server 2007 or in Commerce Server 2009

Applies to: Commerce Server 2009


Consider the following scenario:
  • You enable logons by using the Commerce Server membership provider on a Microsoft Commerce Server 2007 or Microsoft Commerce Server 2009 site. The site uses the ASP.Net authentication.

    Note The ASP.Net authentication uses the HttpContext.Current.User.Identity.Name value in the Profiles database to obtain the UserID Property.
  • An anonymous user visits the site.

    Note The HttpContext.Current.User.Identity.Name field for an anonymous user contains a NULL or empty value.
In this scenario, unnecessary SQL queries search for a UserObject table in the Profiles database.

Note When the HttpContext.Current.User.Identity.Name value is empty, SQL queries cannot locate user profiles by using the empty value.


This issue occurs because of an error in the Microsoft.CommerceServer.Runtime.dll file.

When the CommerceContext.Current.UserID property is accessed, an SQL query automatically searches the Profiles database.


Hotfix information

A supported hotfix is available from Microsoft. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem.

If the hotfix is available for download, there is a "Hotfix download available" section at the top of this Knowledge Base article. If this section does not appear, submit a request to Microsoft Customer Service and Support to obtain the hotfix.

Note If additional issues occur or if any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. For a complete list of Microsoft Customer Service and Support telephone numbers or to create a separate service request, visit the following Microsoft website: Note The "Hotfix download available" form displays the languages for which the hotfix is available. If you do not see your language, it is because a hotfix is not available for that language.


To apply this hotfix, you must have Microsoft Commerce Server 2007 Service Pack 2 (SP2) or Microsoft Commerce Server 2009 installed.

Restart requirement

You do not have to restart the computer after you apply this hotfix. However, you must restart Internet Information Services (IIS) and the Commerce Server Catalog Import Host COM+ application after you apply this hotfix.

To restart IIS, type the following command at a command prompt, and then press ENTER:
Note This command stops and then restarts all IIS services that are running on a computer.

Hotfix replacement information

This hotfix does not replace a previously released hotfix.

File information

The English version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.
Commerce Server 2007
File nameFile versionFile sizeDateTimePlatform
Commerce Server 2009 RTM for Microsoft SharePoint 2007
File nameFile versionFile sizeDateTimePlatform
Commerce Server 2009 Template Pack for Microsoft SharePoint 2010

File nameFile versionFile sizeDateTimePlatform


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.


For more information about the UserID property, visit the following MSDN website:For more information about the Profiles database structure, visit the following MSDN website:For more information about how to use the Commerce Server membership provider, visit the following MSDN website: