[CDBI] Serializing a CDBI object
Bill Moseley <[email protected]> Wed, 2 May 2007 08:01:42 -0700
| Newsgroups | gmane.comp.lang.perl.modules.class-dbi |
|---|---|
| Message-ID | <[email protected]> |
I was looking at the Class::DBI::Storable module and noted that it just stores the id and then does a retrieve on thaw. I have the live object index disabled, so the justification for the above module may not apply. Serializing simple objects seems to work fine, so I'm curious if there's any other issues to be aware of. For one things, serializing objects that have, say, times that are inflated to DateTime objects take up a lot more space when serialized. Is there a better trick than to replace those with a DateTime strings when freezing and then re-inflate when thawing? I'm currently saving the user id in the session and then for each request retrieving the user object again. So, I'm curious to see what it might take to save their object in the session to avoid the trip to the database for every request. In this situation it's ok to have stale user data for the entire session. -- Bill Moseley [email protected]