473,466 Members | 1,366 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

serialization and Session Object

Hello,

I recently read that a class must support serialization in order for it to
be stored in the Session State. Before reading this I had been storing a
class to the Session State no problem (without serialization). The class is
simply a storage class and contains only primitive types....is it necessary
to serialize this object? If so, how do you go about serializing an entire
class?

Thanks much.
Nov 18 '05 #1
5 1389
BTW, using C#. Thanks
"Bilbo" <Bi***@cox.net> wrote in message
news:eZ**************@TK2MSFTNGP10.phx.gbl...
Hello,

I recently read that a class must support serialization in order for it to
be stored in the Session State. Before reading this I had been storing a
class to the Session State no problem (without serialization). The class is simply a storage class and contains only primitive types....is it necessary to serialize this object? If so, how do you go about serializing an entire
class?

Thanks much.

Nov 18 '05 #2
"Bilbo" <Bi***@cox.net> wrote in news:eZDMiA1aEHA.2516
@TK2MSFTNGP10.phx.gbl:
is it necessary
to serialize this object?


I think only if you're using session variables in a webfarm:

http://support.microsoft.com/default...;EN-US;q312112

I never had problems storing complex objects in a sesion variable on a
single web server environment.

--
Lucas Tam (RE********@rogers.com)
Please delete "REMOVE" from the e-mail address when replying.
http://members.ebay.com/aboutme/coolspot18/
Nov 18 '05 #3
It only needs to be serializable if you using session state other then
InProc. If you are using InProc, you can place anything you want into
session.

"Bilbo" <Bi***@cox.net> wrote in message
news:eZ**************@TK2MSFTNGP10.phx.gbl...
Hello,

I recently read that a class must support serialization in order for it to
be stored in the Session State. Before reading this I had been storing a
class to the Session State no problem (without serialization). The class is simply a storage class and contains only primitive types....is it necessary to serialize this object? If so, how do you go about serializing an entire
class?

Thanks much.

Nov 18 '05 #4
Thanks for your response. How can I tell if I am using InProc?

Thanks.
"Marina" <so*****@nospam.com> wrote in message
news:O3****************@tk2msftngp13.phx.gbl...
It only needs to be serializable if you using session state other then
InProc. If you are using InProc, you can place anything you want into
session.

"Bilbo" <Bi***@cox.net> wrote in message
news:eZ**************@TK2MSFTNGP10.phx.gbl...
Hello,

I recently read that a class must support serialization in order for it to be stored in the Session State. Before reading this I had been storing a
class to the Session State no problem (without serialization). The class

is
simply a storage class and contains only primitive types....is it

necessary
to serialize this object? If so, how do you go about serializing an entire class?

Thanks much.


Nov 18 '05 #5
Check in your Web.config, that's where it is set. InProc is the default.

And if you haven't had any serialization warnings after putting custom
objects into session, then you're using InProc.

"Bilbo" <Bi***@cox.net> wrote in message
news:e$*************@TK2MSFTNGP11.phx.gbl...
Thanks for your response. How can I tell if I am using InProc?

Thanks.
"Marina" <so*****@nospam.com> wrote in message
news:O3****************@tk2msftngp13.phx.gbl...
It only needs to be serializable if you using session state other then
InProc. If you are using InProc, you can place anything you want into
session.

"Bilbo" <Bi***@cox.net> wrote in message
news:eZ**************@TK2MSFTNGP10.phx.gbl...
Hello,

I recently read that a class must support serialization in order for it
to
be stored in the Session State. Before reading this I had been storing
a class to the Session State no problem (without serialization). The
class is
simply a storage class and contains only primitive types....is it

necessary
to serialize this object? If so, how do you go about serializing an

entire class?

Thanks much.



Nov 18 '05 #6

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

Similar topics

2
by: Maximus | last post by:
Hi Everyone, I was using Inprocess session objects, but incase of aspnet process crashes the session objects were lost as a result I decided to shift to out of porocess session objects. For this...
3
by: AVL | last post by:
Hi, I'm new to .net. I need some info on serialization. What is serialization? Why do we need it? Why objects need to be serialized if they need to be stored in session or viewstate?
2
by: jakk | last post by:
Below is the exception that Iam getting. It says that the DataView that Iam storing in the session is not Serializable. BUt works fine if I store in the inproc session and fails if I switch to...
0
by: Krishnan | last post by:
Hi, Am having a .Net object which has a COM object as one of its properties and hence normal serialization of the .Net object for StateServer held session doesn't work. To get over this, I...
4
by: Gary | last post by:
Hello, I have implemented SQL Server session state in my application however I am having some problems. Simple objects stored in Session state are fine and are handled by .NET, however when I...
2
by: Jeremy Cowles | last post by:
Hi all, Here is the issue: On postback, I spawn a new thread using the following code: Dim NewThread As New Thread(AddressOf ProcessFile) NewThread.Priority = ThreadPriority.Lowest...
0
by: boris.golubov | last post by:
I'm trying to write an object hierarchy that is serialized into/from XML file of the following structure: <?xml version='1.0'> <Session> <Level1 attr1="1"> <Level2 attr2="11">TEXT11</Level2>...
3
by: Bjorn | last post by:
Hi, I read a lot of things about Serialization but i'm not sure i understand what it is really doing. Anyway, i use in my application the 'Profiles' which must contain things like name of...
0
by: JosAH | last post by:
Introduction Upon hearing the word, "Serialization", the first question which comes to mind is ... "What is Serialization?" We know that we can create resusable objects in Java. But the...
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...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
1
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...
0
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
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 ...

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.