Article ID: 326606 - View products that this article applies to.
This article was previously published under Q326606
When impersonation is enabled for an ASP.NET application that uses SQL Server mode session state management with integrated security, you may see issues that occur when session state is lost or locked for a long time.
ASP.NET may not use impersonation in the following scenarios:
To work around this problem, use one of the following methods:
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
SQL Server session state implements its own connection pooling for open SqlConnection objects. When SQL Server session state saves the data back to the SQL Server database, it uses a background thread. The background thread runs under the ASP.NET worker process (Aspnet_wp.exe in the default ASP.NET installation on Microsoft Windows 2000 and on Microsoft Windows XP, and W3wp.exe in the default ASP.NET installation in Microsoft Windows Server 2003) account. The SQL Server connection attempt is successful if an open SqlConnection object can be found in the pool. However, if no open SqlConnection object can be found in the pool, a SqlConnection object is created through the ASP.NET worker process account. If this account does not have permission to connect to the computer that is running SQL Server, the connection is not successful, and this also results in an unsuccessful attempt to write the session data back to the computer that is running SQL Server. By default, a writer lock is used for a session when the session is accessed. Because of this, the session remains locked until a timeout occurs.
For additional information about using impersonation in ASP.NET applications and using integrated security when you connect to SQL Server, click the following article numbers to view the articles in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/306158/EN-US/ )INFO: Implementing Impersonation in an ASP.NET Application
316989For more information about hotfixes and other related updates for ASP.NET and the .NET Framework, visit the following Microsoft Web sites:
(http://support.microsoft.com/kb/316989/EN-US/ )PRB: "Login Failed" Error Message When You Create a Trusted Data Connection from ASP.NET to SQL Server
.NET Framework - Product Updates