[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: Saving objects with Apache::Session 1.0.x
From:       Jeffrey Baker <jwb () cp ! net>
Date:       1999-09-29 16:48:17
[Download RAW message or body]

Dirk Lutzebaeck wrote:
> 
> I don't know if somebody else came over this but it took me quite a
> while to realize this:
> 
> if you save an object with Apache::Session which itself contains a
> reference then changes in the referenced thingie are not noticed by
> Apache::Session. This due to tie I think and more a feature than a
> bug :/  Jeffery, you might think of putting a blurb about this in the
> documention. This is why I want $session->store back :)

Yes, Apache::Session doesn't do a deep check to see if you have changed
referenced thingies.

You can still force a write in a more elegant way than you describe. 
Just set the state flags on the session object:

tied(%$session)->make_modified;

When you untie the session it will be saved.  Or your could explicitly
save it yourself:

tied(%$session)->make_modified;
tied(%$session)->save;

I'll update the docs.

Cheers,
Jeffrey
-- 
Jeffrey W. Baker * jwb@cp.net
Critical Path, Inc. * we handle the world's email * www.cp.net
415.808.8807

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic