Unable to serialize the session state

A

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.WriteValueToStream(Object value,
BinaryWriter writer) +1710
System.Web.SessionState.SessionDictionary.Serialize(BinaryWriter writer)
+148
System.Web.SessionState.StateClientManager.Serialize(SessionStateItem
item, Stream stream) +146
System.Web.SessionState.SqlStateClientManager.System.Web.SessionState.IStateClientManager.Set(String
id, SessionStateItem item, Boolean inStorage) +126
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source,
EventArgs eventArgs) +464
System.Web.SyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
+60
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +87
 
G

Guest

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 said:
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.WriteValueToStream(Object value,
BinaryWriter writer) +1710
System.Web.SessionState.SessionDictionary.Serialize(BinaryWriter writer)
+148
System.Web.SessionState.StateClientManager.Serialize(SessionStateItem
item, Stream stream) +146
System.Web.SessionState.SqlStateClientManager.System.Web.SessionState.IStateClientManager.Set(String
id, SessionStateItem item, Boolean inStorage) +126
System.Web.SessionState.SessionStateModule.OnReleaseState(Object source,
EventArgs eventArgs) +464
System.Web.SyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
+60
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +87
 
A

Abi

The object being serialized is a datatable. Does a datatable also serialize
as XML as well?

Peter Bromberg said:
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 said:
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.WriteValueToStream(Object value,
BinaryWriter writer) +1710
System.Web.SessionState.SessionDictionary.Serialize(BinaryWriter
writer)
+148
System.Web.SessionState.StateClientManager.Serialize(SessionStateItem
item, Stream stream) +146

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

System.Web.SyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
+60
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +87
 
G

Guest

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 said:
The object being serialized is a datatable. Does a datatable also serialize
as XML as well?

Peter Bromberg said:
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 said:
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.WriteValueToStream(Object value,
BinaryWriter writer) +1710
System.Web.SessionState.SessionDictionary.Serialize(BinaryWriter
writer)
+148
System.Web.SessionState.StateClientManager.Serialize(SessionStateItem
item, Stream stream) +146

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

System.Web.SyncEventExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
+60
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously) +87
 
A

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 said:
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 said:
The object being serialized is a datatable. Does a datatable also
serialize
as XML as well?

message
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




:

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.WriteValueToStream(Object value,
BinaryWriter writer) +1710
System.Web.SessionState.SessionDictionary.Serialize(BinaryWriter
writer)
+148

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

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

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

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top