473,734 Members | 2,798 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SQL Server session not working...

NAT

I was using session mode as "InProc"(entere d in web.config). I have deployed
my ASP.NET appln. on a server which uses Load Balancer. i.e I have two
servers. I am using session across pages.The problem I was facing is that
sometimes I find the session and sometimes not. I beleive this is happenning
because of multiple servers. Because session is created on a worker process
on one server and the second time it must be hitting the other server to
fetch the
session. Hence the issue.I then used SQL Server session mode but now I get
the errror "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'. "
Any Idea ? Thanks in advance..
Jun 14 '06 #1
4 5695
Check all objects that you are storing in session. One of your objects is
exposing an object as public property or field which is non serialzable. An
example could be Thread object which is not serialzable.

Winista
http://www.universalshoppingmall
"NAT" <NA*@discussion s.microsoft.com > wrote in message
news:7F******** *************** ***********@mic rosoft.com...

I was using session mode as "InProc"(entere d in web.config). I have
deployed
my ASP.NET appln. on a server which uses Load Balancer. i.e I have two
servers. I am using session across pages.The problem I was facing is that
sometimes I find the session and sometimes not. I beleive this is
happenning
because of multiple servers. Because session is created on a worker
process
on one server and the second time it must be hitting the other server to
fetch the
session. Hence the issue.I then used SQL Server session mode but now I get
the errror "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'. "
Any Idea ? Thanks in advance..

Jun 14 '06 #2
NAT
So do I need to serialize it ? How can i ?

"Winista" wrote:
Check all objects that you are storing in session. One of your objects is
exposing an object as public property or field which is non serialzable. An
example could be Thread object which is not serialzable.

Winista
http://www.universalshoppingmall
"NAT" <NA*@discussion s.microsoft.com > wrote in message
news:7F******** *************** ***********@mic rosoft.com...

I was using session mode as "InProc"(entere d in web.config). I have
deployed
my ASP.NET appln. on a server which uses Load Balancer. i.e I have two
servers. I am using session across pages.The problem I was facing is that
sometimes I find the session and sometimes not. I beleive this is
happenning
because of multiple servers. Because session is created on a worker
process
on one server and the second time it must be hitting the other server to
fetch the
session. Hence the issue.I then used SQL Server session mode but now I get
the errror "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'. "
Any Idea ? Thanks in advance..


Jun 14 '06 #3
If there is something that does not need to be serialized, make them
non-public or decorate then with Non-serialzable attribute. You will have to
look at your objects closely to make the decision. and if there is something
that needs to be serialzable and by default does not do it by itself then
you will have to manually serialize those objects.
Also put [Serializable] attributes on your objects.

"NAT" <NA*@discussion s.microsoft.com > wrote in message
news:0F******** *************** ***********@mic rosoft.com...
So do I need to serialize it ? How can i ?

"Winista" wrote:
Check all objects that you are storing in session. One of your objects is
exposing an object as public property or field which is non serialzable.
An
example could be Thread object which is not serialzable.

Winista
http://www.universalshoppingmall
"NAT" <NA*@discussion s.microsoft.com > wrote in message
news:7F******** *************** ***********@mic rosoft.com...
>
> I was using session mode as "InProc"(entere d in web.config). I have
> deployed
> my ASP.NET appln. on a server which uses Load Balancer. i.e I have two
> servers. I am using session across pages.The problem I was facing is
> that
> sometimes I find the session and sometimes not. I beleive this is
> happenning
> because of multiple servers. Because session is created on a worker
> process
> on one server and the second time it must be hitting the other server
> to
> fetch the
> session. Hence the issue.I then used SQL Server session mode but now I
> get
> the errror "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'. "
> Any Idea ? Thanks in advance..


Jun 14 '06 #4
note: some object can not be serialized, such as sqlconnections,
datareaders, streams, com interop objects, collections containing a
non-serializable object, etc. in this case you must be redesign you session
data.

you'd think, when asp.net tried to serialize session data, it would list the
name of the object. to find the offending object:

try (air code)

MemoryStream myWriter = new MemoryStream ();
foreach (string key in Session.AllKeys )
{
object o = Session[key];
try
{
XmlSerializer mySerializer = new XmlSerializer(o .GetType());
mySerializer.Se rialize(myWrite r, o);
}
catch
{
Debug.Print("Un able to serialize: " + key);
}
}
myWriter.Close( );
-- bruce (sqlwork.com)


-- bruce (sqlwork.com)


"Winista" <na*********@ho tmail.com> wrote in message
news:O4******** ******@TK2MSFTN GP02.phx.gbl...
If there is something that does not need to be serialized, make them
non-public or decorate then with Non-serialzable attribute. You will have
to look at your objects closely to make the decision. and if there is
something that needs to be serialzable and by default does not do it by
itself then you will have to manually serialize those objects.
Also put [Serializable] attributes on your objects.

"NAT" <NA*@discussion s.microsoft.com > wrote in message
news:0F******** *************** ***********@mic rosoft.com...
So do I need to serialize it ? How can i ?

"Winista" wrote:
Check all objects that you are storing in session. One of your objects
is
exposing an object as public property or field which is non serialzable.
An
example could be Thread object which is not serialzable.

Winista
http://www.universalshoppingmall
"NAT" <NA*@discussion s.microsoft.com > wrote in message
news:7F******** *************** ***********@mic rosoft.com...
>
> I was using session mode as "InProc"(entere d in web.config). I have
> deployed
> my ASP.NET appln. on a server which uses Load Balancer. i.e I have two
> servers. I am using session across pages.The problem I was facing is
> that
> sometimes I find the session and sometimes not. I beleive this is
> happenning
> because of multiple servers. Because session is created on a worker
> process
> on one server and the second time it must be hitting the other server
> to
> fetch the
> session. Hence the issue.I then used SQL Server session mode but now I
> get
> the errror "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'. "
> Any Idea ? Thanks in advance..


Jun 14 '06 #5

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

Similar topics

6
5447
by: Ilia | last post by:
Hi folks, I have some problems with ASP.NET Session State. The following simple program runs well if the Session State set as "InProc". If I switch to "SQLServer", the changes, made by the second thread, are lost. Any idea? I use VS.NET 2003 on Windows Server 2003 with hot fixes (as of 30-Oct-2003) and SQL Server 2000 SP 3a.
2
3376
by: Pete | last post by:
Hi all... I sincerly hope one of the MS guys can clear this up for me... First some background... Ok, I have a web site which is fully translatable into several languages. All the strings for the web site are held in a database and all the labels, buttons etc are populated at run time in the Page_Load handler. The retreval of the strings from the database is all
8
2257
by: Beve Lyni | last post by:
I am running an asp.net project on my localhost and using state server as state management, it has the following code in web.config <sessionState mode="StateServer" stateConnectionString="tcpip=MyMachineName:42424" timeout="20" cookieless="false" /> It had been working fine until I installed Microsoft .Net Framework 1.1 SP1 (and Windows Update) I got error"Unable to make the session state request to the session state
2
6964
by: Jobs | last post by:
Download the JAVA , .NET and SQL Server interview with answers Download the JAVA , .NET and SQL Server interview sheet and rate yourself. This will help you judge yourself are you really worth of attending interviews. If you own a company best way to judge if the candidate is worth of it. http://www.questpond.com/InterviewRatingSheet.zip
12
2906
by: SAL | last post by:
Hello, Is it possible to read a CSV from the Client, and bind my Datagrid to the data in the CSV file without uploading the file to the Server first? I have tried and in Debug mode on my workstation it works fine, but when I publish the page on our DEV server it doesn't fine the CSV file from the client. Has anyone done this before? If so, how do I do it? I'm new to ASP.net so
1
1726
by: Mike Hofer | last post by:
I really need some help, and I'd appreciate any that you folks can provide. The ASP.NET application in question uses version 1.1 of the .NET Framework. All of the pages use a common base class (derived from System.Web.UI.Page). So, for instance, my home page's inheritance chain looks like this: HomePage Inherits WebPageBase
1
15216
by: eblackmo | last post by:
I have a test network consisting of four servers running windows 2003 server R2 SP2. I have set up a domain which functioned correctly for about a day and a half until the other servers decided they can no longer connect to the domain controller. Ping resolves the domain controllers name to the correct ip nslookup finds the ip but can not resolve the name. When I attempt to log on to a machine on the domain it takes around twenty minutes...
5
2077
by: greg | last post by:
Written in Asp.Net 2.0 The session_start fires on Development server running withing Visual Studio 2005 and also if access web site via localhost on development machine. But if copy to development machine event does not fire I created a barebones webapplication not website and put code in session_start will not fire
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9236
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6735
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.