
February 24th, 2004, 06:09 PM
|
|
Contributing User
|
|
Join Date: Feb 2004
Posts: 71
 
Time spent in forums: 1 h 20 m 49 sec
Reputation Power: 10
|
|
Accessing serialized data on DataBase
Hi.
The issue is that I'm using MySQL to store sessions.
In order to store objects for a session, I'm serialzing these objects.
Something like:
Tbl: Session
Fields : SessID as varchar (PK)
SessStart varchar (Session starting time)
SessTimeToLive int ( in seconds)
SessInfo -> the actual information stored in the session
I thought about 2 implementation and I don't know which one is better,
or wether there much better implementation than these:
1. Storing serialized data inside "SessInfo" as an xml doc
In orde to retrieve, I load it to DOM, Find the element by element name,
and de-serializing it's content.
2. Storing serialized data inside dictionary(value), and then serailizing the whole
dictionary.
for example in order to retrieve session data according to a key:
in the "SessInfo" there is currently -----serialized data-----
so:
de-serialize "SessInfo" -> {key1 : serialized value, key2 : serialized value}
get serialized value from key
de-serialize value
Hope I explained it good
Thank you very much
Roy
|