Re: [CDBI] Serializing a CDBI object
"Jon Burdge" <jon-ISkn+Ux/[email protected]> Wed, 2 May 2007 10:12:00 -0700
| Newsgroups | gmane.comp.lang.perl.modules.class-dbi |
|---|---|
| Message-ID | <[email protected]> |
It seems to me that storing anything more than the primary key would be dangerous if there is any chance the data might change between when you serialize and unserialize the data. On 5/2/07, Bill Moseley <[email protected]> wrote: > > 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] > > > _______________________________________________ > ClassDBI mailing list > ClassDBI-Ra3b/[email protected] > http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi > _______________________________________________ ClassDBI mailing list ClassDBI-Ra3b/[email protected] http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi