Article ID: 319345 - Last Review: September 27, 2005 - Revision: 5.1 FIX: Thread abort during SqlCommand.ExecuteReader corrupts SqlConnection poolThis article was previously published under Q319345 SYMPTOMS If the following conditions are true:
System.InvalidOperationException: There is already an open DataReader
associated with this Connection which must be closed first. at System.Data.SqlClient.SqlCommand.ValidateCommand(String method, Boolean executing) at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream) at System.Data.SqlClient.SqlCommand.ExecuteReader() CAUSE When the thread that interacts with the DataReader object is aborted, the connection cannot be cleaned up properly
because the SqlClient.SqlConnection.Close method that contains the cleanup code is not called. This leaves
the connection in an indeterminate state and eventually causes the connection
pool to enter an unusable state. RESOLUTION
To resolve this problem, obtain the latest service pack for Microsoft .NET Framework. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
318836
(http://support.microsoft.com/kb/318836/
)
How to obtain the latest .NET Framework service pack
The English version of this fix should have the
following file attributes or later: Date Version Size File name -------------------------------------------------------------------- 05-Mar-2002 1.0.3705.211 1,175,552 bytes System.data.dll 29-Jan-2002 1,831,936 bytes NDP10U318609.msp STATUSMicrosoft
has confirmed that this is a problem in the Microsoft products that are listed
at the beginning of this article.
This problem was first corrected in Microsoft .NET
Framework Service Pack 2 (SP2). | Article Translations
|

Back to the top
