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

Perrin Harkins perrin at elem.com
Fri Dec 2 22:29:50 GMT 2005

On Fri, 2005-12-02 at 16:31 -0500, Brian Gorby wrote:
> $user = %my_session{my_user};
> I can then make any updates I wish to $user. But why? I thought all I 
> persisted was a reference to some memory that would've gotten destroyed 
> upon restarting of servers.

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.

- Perrin

More information about the ClassDBI mailing list