[CDBI] Class::DBI and Apache::Session - Why does it work?

Brad Bowman list at bereft.net
Fri Dec 2 23:05:29 GMT 2005


> No, you persisted the complete state of the object at that time.  It
> gets run through Storable.
> 
> By the way -- don't do this!  You might lose updates made in the
> database between the time you store it and retrieve it.  The best way to
> handle this is to put the ID into the session and do a fresh retrieve()
> call when you want the object.

Is it worth providing Storable hooks to store only the primary key
then fetch the object afresh when thawing?

http://search.cpan.org/~ams/Storable-2.15/Storable.pm#WIZARDS_ONLY

This has come up a few times now.

Brad

-- 
  When faced with a crisis, if one puts some spittle on his earlobe and
  exhales deeply through his nose, he will overcome anything at hand.
  This is a secret matter.       -- Hagakure http://bereft.net/hagakure/




More information about the ClassDBI mailing list