FIX: Using one SQL database for all applications for SQL Server session state may cause a bottleneck (836680)



The information in this article applies to:

  • Microsoft .NET Framework 1.1
  • Microsoft Visual Studio .NET (2003), Professional Edition
  • Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
  • Microsoft ASP.NET (included with the .NET Framework 1.1)

For a Microsoft .NET Framework 1.0 version of this article, see 820782.

SYMPTOMS

Microsoft SQL Server session state provides a longer and scalable use of session state in Microsoft ASP.NET. However, SQL Server session state uses the same SQL Server database for all applications that are in the same ASPNET process. This behavior may create a single point of failure or may create a bottleneck.

CAUSE

By design, all ASP.NET applications use the same database to store data when they use SQL Server session state. You cannot specify a database name for each application. However, after you apply this software update, you can include the database name in the SQL connection string of a configuration file in the sessionstate section.

RESOLUTION

To resolve this problem, if SQL Server session state is currently configured, remove it by using the original UninstallSqlState.sql script before you install this software update. For more information, see the "References" section.

This software update will install new InstallSqlStateTemplate.sql and UninstallSqlStateTemplate.sql files. Make a copy of these files for each Session database that you want to create. Modify each file by following the instructions that appear in the "More Information" section.

Note These instructions are also included in the comment section of the InstallSqlStateTemplate.sql file.

After you have completed the modifications, run the InstallSqlStateTemplate.sql file to install SQL Server session state for a specified database. After you configure the Session database, modify the sessionstate section of the Web.config file to reference a specific database for the session state, as in the following example:

Note In the following sample code, you must change user id=UserName and password=StrongPassword to the correct values. Make sure that the user ID has the appropriate permissions to perform this operation on the database.
<sessionState 
     mode="SQLServer"
          allowCustomSqlDatabase = "true"
     <!-- This line is a new attribute to sessionState -->
     sqlConnectionString="data source=127.0.0.1;database=mydatabase;user 
              id=UserName;password=StrongPassword"
     cookieless="false" 
     timeout="20" 
/>
Note The sqlConnectionString now contains a parameter for database. In this example, mydatabase is the database that you specify for the session state.

Important This software update contains the following two types of packages:
  • A Microsoft Windows Installer package (.msi file)
  • An Optional Component Manager package (OCM)
If you use Microsoft Windows Server 2003, you must use the Windows Server 2003 (OCM) update because Windows Server 2003 File Protection monitors the .NET Framework 1.1 files. If you use an operating system that is different from Windows Server 2003, you must continue to use the Windows Installer package.

Hotfix information

A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next .NET Framework 1.1 Service Pack 1 that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

File information

The English version of this hotfix has the file attributes (or later) 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 tool in Control Panel.
   Date         Time   Version        Size       File name
   ---------------------------------------------------------------------------------------------
   20-Mar-2004  04:35  1.1.4322.1014    258,048  Aspnet_isapi.dll
   20-Mar-2004  04:35  1.1.4322.1014     20,480  Aspnet_regiis.exe
   20-Mar-2004  04:35  1.1.4322.1014     32,768  Aspnet_state.exe
   20-Mar-2004  04:35  1.1.4322.1014     32,768  Aspnet_wp.exe
   16-May-2003  00:49                    33,522  Installpersistsqlstate.sql
   16-May-2003  00:49                    34,150  Installsqlstate.sql
   03-Oct-2003  19:20                    35,017  Installsqlstatetemplate.sql
   20-Mar-2004  04:24  1.1.4322.1014     94,208  Perfcounter.dll
   20-Mar-2004  04:30                     8,571  Smartnav.js
   22-Mar-2004  04:43  1.1.4322.1014  1,220,608  System.dll
   22-Mar-2004  04:43  1.1.4322.1014    241,664  System.messaging.dll  
   22-Mar-2004  04:43  1.1.4322.1014    323,584  System.runtime.remoting.dll
   22-Mar-2004  04:43  1.1.4322.1014    131,072  System.runtime.serialization.formatters.soap.dll
   22-Mar-2004  04:43  1.1.4322.1014  1,257,472  System.web.dll
   22-Mar-2004  04:43  1.1.4322.1014    819,200  System.web.mobile.dll
   22-Mar-2004  04:43  1.1.4322.1014    569,344  System.web.services.dll
   22-Mar-2004  04:43  1.1.4322.1014  1,339,392  System.xml.dll
   03-Oct-2003  19:20                     2,119  Uninstallsqlstatetemplate.sql
   20-Mar-2004  04:30                    14,482  Webuivalidation.js

STATUS

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

MORE INFORMATION

Use the templates files to install the ASP.NET session state SQL objects

Use the Installsqlstatetemplate.sql templates file to install the ASP.NET session state SQL objects on a database that is different from the default ASPState database. To do this, follow these steps:
  1. Create your own script files by copying the two template files Installsqlstatetemplate.sql and Uninstallsqlstatetemplate.sql.
  2. Create a name for your database (for example, MyASPStateDB).
  3. In your own script files, replace all occurrences of DatabaseNamePlaceHolder with the name of your database.
  4. Install and then remove ASP.NET session state SQL objects by using your own script files.

REFERENCES

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

824684 Description of the standard terminology that is used to describe Microsoft software updates

For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

317604 How to configure SQL Server to store ASP.NET session state


Modification Type:MajorLast Reviewed:4/7/2006
Keywords:kbQFE KBHotfixServer kbSQLServ700sp2fix kbState kbConfig kbAppSetup kbBug kbNetFrame110preSP1fix KB836680 kbAudDeveloper