"There is already an open DataReader" ... fun ... fun... fun...

Published 02 September 04 04:50 PM | alexcampbell

If you think that my blog seems to primarily devoted to whinging then... well spotted.

Today's second gripe is about a feature in the .Net Framework 1.1 that causes the following exception to be thrown at random times of high load: 

System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown.
---> 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(CommandBehavior behavior

It apparently occurs because of a thread locking issue in the Framework data access page (http://support.microsoft.com/default.aspx?scid=KB;EN-US;319345) that hasn't been fixed in the latest service pack (judging by http://support.microsoft.com/?kbid=867460).

Comments

# Jerry Pisk said on September 2, 2004 03:47 AM:

According to the links you posted the bug only applies to .Net 1.0 and was fixed in SP2. That's probably why it isn't listed in 1.1 service pack.