473,326 Members | 2,125 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,326 software developers and data experts.

Serialize Object in Session?

Is it recommended to serialize a custom object when putting it in session?

I have a User object with properties ID, FirstName, LastName, and an
array of Permissions which I would like to keep in session. Should I
first serialize it to put it in session? I read that this is not
necessary, but I'm wondering about memory usage and performance. I
realize that serializing/deserializing the object will take time, but
will the serialized object consume less memory than the non serialized
object? If so, will it be significant. Thanks.
Nov 17 '05 #1
2 2115
> Is it recommended to serialize a custom object when putting it in session?

No.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Neither a follower nor a lender be.

"nick" <ni**********@hotmail.com> wrote in message
news:30*************************@posting.google.co m...
Is it recommended to serialize a custom object when putting it in session?

I have a User object with properties ID, FirstName, LastName, and an
array of Permissions which I would like to keep in session. Should I
first serialize it to put it in session? I read that this is not
necessary, but I'm wondering about memory usage and performance. I
realize that serializing/deserializing the object will take time, but
will the serialized object consume less memory than the non serialized
object? If so, will it be significant. Thanks.

Nov 17 '05 #2
Serialize objects can recreate themselves from the stream.

So usually serialized representation of the object takes up more space than
object itself.

George.

"nick" <ni**********@hotmail.com> wrote in message
news:30*************************@posting.google.co m...
Is it recommended to serialize a custom object when putting it in session?

I have a User object with properties ID, FirstName, LastName, and an
array of Permissions which I would like to keep in session. Should I
first serialize it to put it in session? I read that this is not
necessary, but I'm wondering about memory usage and performance. I
realize that serializing/deserializing the object will take time, but
will the serialized object consume less memory than the non serialized
object? If so, will it be significant. Thanks.

Nov 17 '05 #3

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

Similar topics

0
by: Drew | last post by:
Hello- I have am ASP.Net DataGrid object that I bind to from the result of a query. In order to not retrieve this dataset again when the user presses forward and back, I keep the dataset in a...
3
by: Gordz | last post by:
I've been experiencing problems on some computers with XML Serialization. On some computers the files do not get created on the web server's hard drive and it's been driving me nuts trying to...
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...
2
by: Dave | last post by:
I have an application running on a 3 server webfarm running Windows 2003 with SQLServer Session state. After running for several hours, I started getting the following error. When I access each...
6
by: py | last post by:
I want to serialize an object in jython and then be able to read it in using python, and vice versa. Any suggestions on how to do this? pickle doesnt work, nor does using ObjectOutputStream...
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...
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.