serialize object and store in a database

  • Thread starter Thread starter Tony Johansson
  • Start date Start date
Tony said:
Hi!

Is it common to serialized object and then store it in a database ?

//Tony

Yeah, I do it with keeping Web session variable of object or object
graphic and serialize it to save to a Varchar(max), using
XMLseralization on the object to serialize and deserialize the object.

It's done for session timeout to to keep object state and restore object
back to its state at time of timeout.

Of course, the SQL server record is using an Identity key, sessionid or
user-id and or some other type of information to make it unique with
date and timestamp so I and query the database to get the object back to
deserialize it back to the object or object graph and but it back into
session.
 
Is it common to serialized object and then store it in a database ?

In all C# code: no - it happens occasionally

In C# code that serializes to memory stream: yes - it is one of the
common reasons

Arne
 
Back
Top