473,382 Members | 1,791 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Unable to serialize the session state

Abi
We able to generate this error in our test environment and were able to
research this enough to understand that the issue is NOT with an abject that
needs to be serialized but rather as the stack trace suggests that the
server (in the web farm) ran out of memory while attempting to stream data
to an ASP Session State database (SQL Server 2000) .

Our test environment consists of:
- 3 web servers Load Balanced
- SQL Server 2000 Database Cluster
- F5 switch (handles the BIG IP)

We were able to simulate this error from 3 clients each opening 6 unique IE
sessions and retrieving the same data (Search) which expects to return 11000
records ... Not to the page tho! :-). Each of the Clients encountered the
error in at least 4 sessions.

The workaround is obviously not to return the 11000 records unless
absolutely required, however we do need to find a solution to this. It seems
there are others who have encountered such issues before. I'd like to
understand how they were able to resolve this issue, if at all.

Any suggestions/Solutions will be greatly appreciated.

thanks

Abhinav

Server Error in '/' Application.
--------------------------------------------------------------------------------

Unable to serialize the session state. Please note that non-serializable
objects or MarshalByRef objects are not permitted when session state mode is
'StateServer' or 'SQLServer'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Unable to serialize the session
state. Please note that non-serializable objects or MarshalByRef objects are
not permitted when session state mode is 'StateServer' or 'SQLServer'.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[OutOfMemoryException: Exception of type System.OutOfMemoryException was
thrown.]

[HttpException (0x80004005): Unable to serialize the session state. Please
note that non-serializable objects or MarshalByRef objects are not permitted
when session state mode is 'StateServer' or 'SQLServer'.]
System.Web.Util.AltSerialization.WriteValueToStrea m(Object value,
BinaryWriter writer) +1710
System.Web.SessionState.SessionDictionary.Serializ e(BinaryWriter writer)
+148
System.Web.SessionState.StateClientManager.Seriali ze(SessionStateItem
item, Stream stream) +146
System.Web.SessionState.SqlStateClientManager.Syst em.Web.SessionState.IStateClientManager.Set(String
id, SessionStateItem item, Boolean inStorage) +126
System.Web.SessionState.SessionStateModule.OnRelea seState(Object source,
EventArgs eventArgs) +464
System.Web.SyncEventExecutionStep.System.Web.HttpA pplication+IExecutionStep.Execute()
+60
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +87

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET
Version:1.1.4322.2300
Jul 13 '06 #1
4 9495
Abi,
Exactly "What" is the actual object with 11000 "records" that is being asked
to be serialized? Is it a DataSet? In 1.1, the DataSet only serializes as XML
and that takes up a huge amount memory and is also quite a slow operation.

You might wish to search MSDN for Ravinder Vuppula's DataSetSurrogate class
which "Flattens out" the DataSet to a more compact and binary serializable
class, or convert your object to something like arraylists, etc.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Abi" wrote:
We able to generate this error in our test environment and were able to
research this enough to understand that the issue is NOT with an abject that
needs to be serialized but rather as the stack trace suggests that the
server (in the web farm) ran out of memory while attempting to stream data
to an ASP Session State database (SQL Server 2000) .

Our test environment consists of:
- 3 web servers Load Balanced
- SQL Server 2000 Database Cluster
- F5 switch (handles the BIG IP)

We were able to simulate this error from 3 clients each opening 6 unique IE
sessions and retrieving the same data (Search) which expects to return 11000
records ... Not to the page tho! :-). Each of the Clients encountered the
error in at least 4 sessions.

The workaround is obviously not to return the 11000 records unless
absolutely required, however we do need to find a solution to this. It seems
there are others who have encountered such issues before. I'd like to
understand how they were able to resolve this issue, if at all.

Any suggestions/Solutions will be greatly appreciated.

thanks

Abhinav

Server Error in '/' Application.
--------------------------------------------------------------------------------

Unable to serialize the session state. Please note that non-serializable
objects or MarshalByRef objects are not permitted when session state mode is
'StateServer' or 'SQLServer'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Unable to serialize the session
state. Please note that non-serializable objects or MarshalByRef objects are
not permitted when session state mode is 'StateServer' or 'SQLServer'.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[OutOfMemoryException: Exception of type System.OutOfMemoryException was
thrown.]

[HttpException (0x80004005): Unable to serialize the session state. Please
note that non-serializable objects or MarshalByRef objects are not permitted
when session state mode is 'StateServer' or 'SQLServer'.]
System.Web.Util.AltSerialization.WriteValueToStrea m(Object value,
BinaryWriter writer) +1710
System.Web.SessionState.SessionDictionary.Serializ e(BinaryWriter writer)
+148
System.Web.SessionState.StateClientManager.Seriali ze(SessionStateItem
item, Stream stream) +146
System.Web.SessionState.SqlStateClientManager.Syst em.Web.SessionState.IStateClientManager.Set(String
id, SessionStateItem item, Boolean inStorage) +126
System.Web.SessionState.SessionStateModule.OnRelea seState(Object source,
EventArgs eventArgs) +464
System.Web.SyncEventExecutionStep.System.Web.HttpA pplication+IExecutionStep.Execute()
+60
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +87

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET
Version:1.1.4322.2300
Jul 13 '06 #2
Abi
The object being serialized is a datatable. Does a datatable also serialize
as XML as well?

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.comwrote in message
news:96**********************************@microsof t.com...
Abi,
Exactly "What" is the actual object with 11000 "records" that is being
asked
to be serialized? Is it a DataSet? In 1.1, the DataSet only serializes as
XML
and that takes up a huge amount memory and is also quite a slow operation.

You might wish to search MSDN for Ravinder Vuppula's DataSetSurrogate
class
which "Flattens out" the DataSet to a more compact and binary serializable
class, or convert your object to something like arraylists, etc.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Abi" wrote:
>We able to generate this error in our test environment and were able to
research this enough to understand that the issue is NOT with an abject
that
needs to be serialized but rather as the stack trace suggests that the
server (in the web farm) ran out of memory while attempting to stream
data
to an ASP Session State database (SQL Server 2000) .

Our test environment consists of:
- 3 web servers Load Balanced
- SQL Server 2000 Database Cluster
- F5 switch (handles the BIG IP)

We were able to simulate this error from 3 clients each opening 6 unique
IE
sessions and retrieving the same data (Search) which expects to return
11000
records ... Not to the page tho! :-). Each of the Clients encountered the
error in at least 4 sessions.

The workaround is obviously not to return the 11000 records unless
absolutely required, however we do need to find a solution to this. It
seems
there are others who have encountered such issues before. I'd like to
understand how they were able to resolve this issue, if at all.

Any suggestions/Solutions will be greatly appreciated.

thanks

Abhinav

Server Error in '/' Application.
--------------------------------------------------------------------------------

Unable to serialize the session state. Please note that non-serializable
objects or MarshalByRef objects are not permitted when session state mode
is
'StateServer' or 'SQLServer'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Unable to serialize the
session
state. Please note that non-serializable objects or MarshalByRef objects
are
not permitted when session state mode is 'StateServer' or 'SQLServer'.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[OutOfMemoryException: Exception of type System.OutOfMemoryException was
thrown.]

[HttpException (0x80004005): Unable to serialize the session state.
Please
note that non-serializable objects or MarshalByRef objects are not
permitted
when session state mode is 'StateServer' or 'SQLServer'.]
System.Web.Util.AltSerialization.WriteValueToStrea m(Object value,
BinaryWriter writer) +1710
System.Web.SessionState.SessionDictionary.Serializ e(BinaryWriter
writer)
+148
System.Web.SessionState.StateClientManager.Seriali ze(SessionStateItem
item, Stream stream) +146

System.Web.SessionState.SqlStateClientManager.Sys tem.Web.SessionState.IStateClientManager.Set(Strin g
id, SessionStateItem item, Boolean inStorage) +126
System.Web.SessionState.SessionStateModule.OnRelea seState(Object
source,
EventArgs eventArgs) +464

System.Web.SyncEventExecutionStep.System.Web.Http Application+IExecutionStep.Execute()
+60
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +87

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2300;
ASP.NET
Version:1.1.4322.2300

Jul 13 '06 #3
No, a DataTable is not. Put the DataTable inside a new DataSet first.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Abi" wrote:
The object being serialized is a datatable. Does a datatable also serialize
as XML as well?

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.comwrote in message
news:96**********************************@microsof t.com...
Abi,
Exactly "What" is the actual object with 11000 "records" that is being
asked
to be serialized? Is it a DataSet? In 1.1, the DataSet only serializes as
XML
and that takes up a huge amount memory and is also quite a slow operation.

You might wish to search MSDN for Ravinder Vuppula's DataSetSurrogate
class
which "Flattens out" the DataSet to a more compact and binary serializable
class, or convert your object to something like arraylists, etc.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Abi" wrote:
We able to generate this error in our test environment and were able to
research this enough to understand that the issue is NOT with an abject
that
needs to be serialized but rather as the stack trace suggests that the
server (in the web farm) ran out of memory while attempting to stream
data
to an ASP Session State database (SQL Server 2000) .

Our test environment consists of:
- 3 web servers Load Balanced
- SQL Server 2000 Database Cluster
- F5 switch (handles the BIG IP)

We were able to simulate this error from 3 clients each opening 6 unique
IE
sessions and retrieving the same data (Search) which expects to return
11000
records ... Not to the page tho! :-). Each of the Clients encountered the
error in at least 4 sessions.

The workaround is obviously not to return the 11000 records unless
absolutely required, however we do need to find a solution to this. It
seems
there are others who have encountered such issues before. I'd like to
understand how they were able to resolve this issue, if at all.

Any suggestions/Solutions will be greatly appreciated.

thanks

Abhinav

Server Error in '/' Application.
--------------------------------------------------------------------------------

Unable to serialize the session state. Please note that non-serializable
objects or MarshalByRef objects are not permitted when session state mode
is
'StateServer' or 'SQLServer'.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Unable to serialize the
session
state. Please note that non-serializable objects or MarshalByRef objects
are
not permitted when session state mode is 'StateServer' or 'SQLServer'.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of the
exception can be identified using the exception stack trace below.

Stack Trace:

[OutOfMemoryException: Exception of type System.OutOfMemoryException was
thrown.]

[HttpException (0x80004005): Unable to serialize the session state.
Please
note that non-serializable objects or MarshalByRef objects are not
permitted
when session state mode is 'StateServer' or 'SQLServer'.]
System.Web.Util.AltSerialization.WriteValueToStrea m(Object value,
BinaryWriter writer) +1710
System.Web.SessionState.SessionDictionary.Serializ e(BinaryWriter
writer)
+148
System.Web.SessionState.StateClientManager.Seriali ze(SessionStateItem
item, Stream stream) +146

System.Web.SessionState.SqlStateClientManager.Syst em.Web.SessionState.IStateClientManager.Set(String
id, SessionStateItem item, Boolean inStorage) +126
System.Web.SessionState.SessionStateModule.OnRelea seState(Object
source,
EventArgs eventArgs) +464

System.Web.SyncEventExecutionStep.System.Web.HttpA pplication+IExecutionStep.Execute()
+60
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step, Boolean&
completedSynchronously) +87

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2300;
ASP.NET
Version:1.1.4322.2300


Jul 13 '06 #4
Abi
Any advantage in moving the datatable to the dataset? You did point out that
the XML serialization is slower and resource hungry. So I'm thinking its
going to get worse!

Being that we are pushing a datatable into session state db are there any
other likely causes?

Appreciate all your input.

thanks

Abhinav

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.comwrote in message
news:81**********************************@microsof t.com...
No, a DataTable is not. Put the DataTable inside a new DataSet first.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Abi" wrote:
>The object being serialized is a datatable. Does a datatable also
serialize
as XML as well?

"Peter Bromberg [C# MVP]" <pb*******@yahoo.nospammin.comwrote in
message
news:96**********************************@microso ft.com...
Abi,
Exactly "What" is the actual object with 11000 "records" that is being
asked
to be serialized? Is it a DataSet? In 1.1, the DataSet only serializes
as
XML
and that takes up a huge amount memory and is also quite a slow
operation.

You might wish to search MSDN for Ravinder Vuppula's DataSetSurrogate
class
which "Flattens out" the DataSet to a more compact and binary
serializable
class, or convert your object to something like arraylists, etc.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Abi" wrote:

We able to generate this error in our test environment and were able
to
research this enough to understand that the issue is NOT with an
abject
that
needs to be serialized but rather as the stack trace suggests that the
server (in the web farm) ran out of memory while attempting to stream
data
to an ASP Session State database (SQL Server 2000) .

Our test environment consists of:
- 3 web servers Load Balanced
- SQL Server 2000 Database Cluster
- F5 switch (handles the BIG IP)

We were able to simulate this error from 3 clients each opening 6
unique
IE
sessions and retrieving the same data (Search) which expects to return
11000
records ... Not to the page tho! :-). Each of the Clients encountered
the
error in at least 4 sessions.

The workaround is obviously not to return the 11000 records unless
absolutely required, however we do need to find a solution to this. It
seems
there are others who have encountered such issues before. I'd like to
understand how they were able to resolve this issue, if at all.

Any suggestions/Solutions will be greatly appreciated.

thanks

Abhinav

Server Error in '/' Application.
--------------------------------------------------------------------------------

Unable to serialize the session state. Please note that
non-serializable
objects or MarshalByRef objects are not permitted when session state
mode
is
'StateServer' or 'SQLServer'.
Description: An unhandled exception occurred during the execution of
the
current web request. Please review the stack trace for more
information
about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Unable to serialize the
session
state. Please note that non-serializable objects or MarshalByRef
objects
are
not permitted when session state mode is 'StateServer' or 'SQLServer'.

Source Error:

An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the
exception can be identified using the exception stack trace below.

Stack Trace:

[OutOfMemoryException: Exception of type System.OutOfMemoryException
was
thrown.]

[HttpException (0x80004005): Unable to serialize the session state.
Please
note that non-serializable objects or MarshalByRef objects are not
permitted
when session state mode is 'StateServer' or 'SQLServer'.]
System.Web.Util.AltSerialization.WriteValueToStrea m(Object value,
BinaryWriter writer) +1710
System.Web.SessionState.SessionDictionary.Serializ e(BinaryWriter
writer)
+148

System.Web.SessionState.StateClientManager.Serial ize(SessionStateItem
item, Stream stream) +146

System.Web.SessionState.SqlStateClientManager.Sys tem.Web.SessionState.IStateClientManager.Set(Strin g
id, SessionStateItem item, Boolean inStorage) +126
System.Web.SessionState.SessionStateModule.OnRelea seState(Object
source,
EventArgs eventArgs) +464

System.Web.SyncEventExecutionStep.System.Web.Http Application+IExecutionStep.Execute()
+60
System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
Boolean&
completedSynchronously) +87

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2300;
ASP.NET
Version:1.1.4322.2300



Jul 13 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dave | last post by:
We just started getting this error message in our application today (stack trace below). From the OutOfMemoryException, I'm guessing it could be a memory leak. I'm making sure I'm closing all my...
0
by: Maciek | last post by:
Hi When I set Session state mode to StateServer (IIS 6.0; windows2003; .NET 2.0) in my application, I have recived this message:...
1
by: js | last post by:
Does anybody knows how to solve the problem? I added attribute to the following classes in Microsoft.Practices.EnterpriseLibrary.Data namespace, but I still get the error. Thanks. ...
1
by: Tim | last post by:
Could anyone tell me what this means and how do I correct it. Any suggestions? Thanks! Tim Richardson IT Developer and Consultant www.paladin3d.com Unable to serialize the session state. In...
6
by: tshad | last post by:
I had asked about this before, but have been unable to solve the problem. Could this be a problem with Web Services? I have 4 web services that I reference in this object. There is only one...
0
by: Nachi | last post by:
I have installed SQL Server 2000 with VS 2005 - did not install SqlExpress\Sql 2005. I have a remote Sql Server Instance locally. The normal application connectes to this Sql Server. When I run...
3
by: =?Utf-8?B?VG9ueSBTZXI=?= | last post by:
Come across an issue with IIS process HTTP request one by one, not simultaneously. I have a page that takes a long time to process. When the page is accessed by 2 seperate browser, both request...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.