Error using ReportViewer control and SQL Session State


A

Andrew Teece

Hope someone can help.
We are trying to deploy an ASP.Net 2.0 application to a 3-node webfarm.
The application uses the ReportViewer control in local mode, hence we
need session state.
Because we dont wan't a single point of failure we use SQL Session
State.
I have setup a persistant sql session state database on a SQL 2000
server (this is a cluster in production, so no SPOF)
I have setup our web.config files to include;
" <sessionState cookieless="false"
mode="SQLServer"
allowCustomSqlDatabase="true"
sqlConnectionString="data
source=xxxxxxxxxxxx;database=xxxxxxxxxxxxxxxxxx;user
id=xxxxxxxxxxxxxxxxxxx;password=xxxxxxxxxxxxxxxxxxxxx"
timeout="20" />"

Problem is, when I try to render a report, I get the following error, and
the session isnt ever useable again;
"System.Web.HttpException: Exception of type 'System.Web.HttpException' was
thrown. ---> System.Web.HttpException: Unable to connect to SQL Server
session database. ---> System.InvalidOperationException: Internal connection
fatal error.
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand
cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.CloseInternal(Boolean closeReader)
at System.Data.SqlClient.SqlDataReader.Close()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds,
RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method,
DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior,
String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader()
at System.Web.SessionState.SqlSessionStateStore.DoGet(HttpContext context,
String id, Boolean getExclusive, Boolean& locked, TimeSpan& lockAge, Object&
lockId, SessionStateActions& actionFlags)
--- End of inner exception stack trace ---
at
System.Web.SessionState.SqlSessionStateStore.ThrowSqlConnectionException(SqlConnection
conn, Exception e)
at System.Web.SessionState.SqlSessionStateStore.DoGet(HttpContext context,
String id, Boolean getExclusive, Boolean& locked, TimeSpan& lockAge, Object&
lockId, SessionStateActions& actionFlags)
at System.Web.SessionState.SqlSessionStateStore.GetItemExclusive(HttpContext
context, String id, Boolean& locked, TimeSpan& lockAge, Object& lockId,
SessionStateActions& actionFlags)
at System.Web.SessionState.SessionStateModule.GetSessionStateItem()
at
System.Web.SessionState.SessionStateModule.PollLockedSessionCallback(Object
state)
--- End of inner exception stack trace ---
at System.Web.HttpAsyncResult.End()
at System.Web.SessionState.SessionStateModule.EndAcquireState(IAsyncResult
ar)
at
System.Web.HttpApplication.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult
ar)
System.Web.HttpException: Unable to connect to SQL Server session
database. ---> System.InvalidOperationException: Internal connection fatal
error.
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand
cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.CloseInternal(Boolean closeReader)
at System.Data.SqlClient.SqlDataReader.Close()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds,
RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method,
DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior,
String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader()
at System.Web.SessionState.SqlSessionStateStore.DoGet(HttpContext context,
String id, Boolean getExclusive, Boolean& locked, TimeSpan& lockAge, Object&
lockId, SessionStateActions& actionFlags)
--- End of inner exception stack trace ---
at
System.Web.SessionState.SqlSessionStateStore.ThrowSqlConnectionException(SqlConnection
conn, Exception e)
at System.Web.SessionState.SqlSessionStateStore.DoGet(HttpContext context,
String id, Boolean getExclusive, Boolean& locked, TimeSpan& lockAge, Object&
lockId, SessionStateActions& actionFlags)
at System.Web.SessionState.SqlSessionStateStore.GetItemExclusive(HttpContext
context, String id, Boolean& locked, TimeSpan& lockAge, Object& lockId,
SessionStateActions& actionFlags)
at System.Web.SessionState.SessionStateModule.GetSessionStateItem()
at
System.Web.SessionState.SessionStateModule.PollLockedSessionCallback(Object
state)
System.InvalidOperationException: Internal connection fatal error.
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand
cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.CloseInternal(Boolean closeReader)
at System.Data.SqlClient.SqlDataReader.Close()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds,
RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method,
DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior,
String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader()
at System.Web.SessionState.SqlSessionStateStore.DoGet(HttpContext context,
String id, Boolean getExclusive, Boolean& locked, TimeSpan& lockAge, Object&
lockId, SessionStateActions& actionFlags)
"


Regards




Andrew Teece
Technical Architect, eNate
 
Ad

Advertisements

S

Steven Cheng[MSFT]

Hi Andrew,

From your description, I understand you have an ASP.NET application that
use the web reportviewer to display local RDLC report. Since it require
sessionstate and your application is deployed on webfarm servers, you
configure the sessionstate as SQL Server session, however, you still get
exception against sessionstate at runtime ,correct?

Based on the exception callstack you provided, it seems the exception is
completely thrown during the session state's querying(in the SQL Session
processing). Therefore, I'm wondering whether you'll get the same error if
you simply store and retrieve a normal session state item. Have you tried
store some simple data into Session and retrieve it to see whether you'll
get the exception? In addition, from some former issue which have similar
symptom, they're caused by using cookieless sessionstate or async page
model, does this also apply to your scenario?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

Andrew Teece

Steven,
Your understanding is completely correct.

I have not used session state anywhere in the application at the moment,
but I will put together a small sample site using the same SQL server.

I have read about the similar symptoms caused by cookieless and async
page model. We are using neither. And I have tried turning on cookieless
session state, which did cause a problem, but it was a different exception.

I think that it is also worth noting that after I try to use the report
page, the whole site is unavailable to the client-session. I must close and
re-open IE to get a new session, and no error is produced when this happens,
it just times out! - To me, it is like after the report viewer opens a
connection to the DB (same server, obviously different database) then the
session state connection is lost and cannot connect to the DB anymore.

If I use in-process session state, the page does work correctly.



Regards




Andrew
 
S

Sean Winstead

I can't help other than to say that I've encountered the same error, just in a different situation.

Did you happen to resolve this problem?

Sean Winstead
Hope someone can help.
We are trying to deploy an ASP.Net 2.0 application to a 3-node webfarm.
The application uses the ReportViewer control in local mode, hence we
need session state.
Because we dont wan't a single point of failure we use SQL Session
State.
I have setup a persistant sql session state database on a SQL 2000
server (this is a cluster in production, so no SPOF)
I have setup our web.config files to include;
" <sessionState cookieless="false"
mode="SQLServer"
allowCustomSqlDatabase="true"
sqlConnectionString="data
source=xxxxxxxxxxxx;database=xxxxxxxxxxxxxxxxxx;user
id=xxxxxxxxxxxxxxxxxxx;password=xxxxxxxxxxxxxxxxxxxxx"
timeout="20" />"

Problem is, when I try to render a report, I get the following error, and
the session isnt ever useable again;
"System.Web.HttpException: Exception of type 'System.Web.HttpException' was
thrown. ---> System.Web.HttpException: Unable to connect to SQL Server
session database. ---> System.InvalidOperationException: Internal connection
fatal error.
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand
cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.CloseInternal(Boolean closeReader)
at System.Data.SqlClient.SqlDataReader.Close()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds,
RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method,
DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior,
String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader()
at System.Web.SessionState.SqlSessionStateStore.DoGet(HttpContext context,
String id, Boolean getExclusive, Boolean& locked, TimeSpan& lockAge, Object&
lockId, SessionStateActions& actionFlags)
--- End of inner exception stack trace ---
at
System.Web.SessionState.SqlSessionStateStore.ThrowSqlConnectionException(SqlConnection
conn, Exception e)
at System.Web.SessionState.SqlSessionStateStore.DoGet(HttpContext context,
String id, Boolean getExclusive, Boolean& locked, TimeSpan& lockAge, Object&
lockId, SessionStateActions& actionFlags)
at System.Web.SessionState.SqlSessionStateStore.GetItemExclusive(HttpContext
context, String id, Boolean& locked, TimeSpan& lockAge, Object& lockId,
SessionStateActions& actionFlags)
at System.Web.SessionState.SessionStateModule.GetSessionStateItem()
at
System.Web.SessionState.SessionStateModule.PollLockedSessionCallback(Object
state)
--- End of inner exception stack trace ---
at System.Web.HttpAsyncResult.End()
at System.Web.SessionState.SessionStateModule.EndAcquireState(IAsyncResult
ar)
at
System.Web.HttpApplication.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult
ar)
System.Web.HttpException: Unable to connect to SQL Server session
database. ---> System.InvalidOperationException: Internal connection fatal
error.
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand
cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.CloseInternal(Boolean closeReader)
at System.Data.SqlClient.SqlDataReader.Close()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds,
RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method,
DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior,
String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader()
at System.Web.SessionState.SqlSessionStateStore.DoGet(HttpContext context,
String id, Boolean getExclusive, Boolean& locked, TimeSpan& lockAge, Object&
lockId, SessionStateActions& actionFlags)
--- End of inner exception stack trace ---
at
System.Web.SessionState.SqlSessionStateStore.ThrowSqlConnectionException(SqlConnection
conn, Exception e)
at System.Web.SessionState.SqlSessionStateStore.DoGet(HttpContext context,
String id, Boolean getExclusive, Boolean& locked, TimeSpan& lockAge, Object&
lockId, SessionStateActions& actionFlags)
at System.Web.SessionState.SqlSessionStateStore.GetItemExclusive(HttpContext
context, String id, Boolean& locked, TimeSpan& lockAge, Object& lockId,
SessionStateActions& actionFlags)
at System.Web.SessionState.SessionStateModule.GetSessionStateItem()
at
System.Web.SessionState.SessionStateModule.PollLockedSessionCallback(Object
state)
System.InvalidOperationException: Internal connection fatal error.
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand
cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.CloseInternal(Boolean closeReader)
at System.Data.SqlClient.SqlDataReader.Close()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds,
RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method,
DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior,
String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader()
at System.Web.SessionState.SqlSessionStateStore.DoGet(HttpContext context,
String id, Boolean getExclusive, Boolean& locked, TimeSpan& lockAge, Object&
lockId, SessionStateActions& actionFlags)
"


Regards




Andrew Teece
Technical Architect, eNate



___
Newsgroups brought to you courtesy of www.dotnetjohn.com
 
A

Andrew Teece

Not yet


I'm still working on this issue. Hopefully with MS support as I'm an MSDN
subscriber.



Watch this space, literally!



Andrew
 
A

Andrew Teece

Steven,
I can now confirm that Session State to SQL works with some string data
in a session.

It only seems to fail after using the report viewer control.


Andrew
 
Ad

Advertisements

S

Steven Cheng[MSFT]

Hi Andrew,

Thanks for your reply and the further info.

So normal sessionstate accessing work well. In your previous message, you
mentioned that the SQL Server session database is on the same server
instance with your report or any other application data's database,
correct? I think this is possibly the potential cause. Have you tried
separate the database to see if it would help some?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
A

Andrew Teece

Sorry for any confusion here, but it is on the same database server, but it
is not in the same database.


Regards


Andrew
 
Ad

Advertisements

S

Steven Cheng[MSFT]

Thanks for your reply Andrew,

Then will it help if you move one of the database to another server
instance? So far this is the only obvious things I can get from the
surface. Also, due to the current status of the issue, it may require
further troubleshooting on the target environment and it would be a bit
hard through the newsgroup support interface. If this is an urgent issue,
you can consider contact CSS for incident based support:

http://msdn.microsoft.com/subscriptions/support/default.aspx

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top