Re: [CDBI] Serializing a CDBI object
"Perrin Harkins" <[email protected]> Thu, 3 May 2007 07:02:43 -0400
| Newsgroups | gmane.comp.lang.perl.modules.class-dbi |
|---|---|
| Message-ID | <[email protected]> |
On 5/2/07, Bill Moseley <[email protected]> wrote: > Serializing simple objects seems to work fine, so I'm curious if > there's any other issues to be aware of. If there's nothing in the objects that won't serialize (DBI connections, closures), you should be able to do it. The main issue is that your object will be out of syn with the database, so you would miss any updates done from other places. There's also the possibility that the cost of serialization and dumping to your session storage will be the same as the cost of fetching the object from the db. > For one things, serializing objects that have, say, times that are > inflated to DateTime objects take up a lot more space when serialized. That surprises me. DateTime has specific Storable hooks to address this problem. - Perrin