[CDBI] Serializing a CDBI object
jon at burdge.org
Wed May 2 18:12:00 BST 2007
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 <moseley at hank.org> 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
> moseley at hank.org
> ClassDBI mailing list
> ClassDBI at lists.digitalcraftsmen.net
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ClassDBI