Tried timestamping the second layer, and saving directly, no luck.

Shrugged and dropped the midlevel tax_swap hash and it's working now.

Thanks.


On Thu, 2003-10-23 at 14:16, Perrin Harkins wrote:
> Hi Brendan,
> 
> > I'm trying to store an object (simple datatype, just a blessed hash
> > inside) within Apache::Session.  I'm doing this:
> > $session->{tax_swap}->{preview_sell_candidates} = [EMAIL PROTECTED]; 
> > where @items is an array of SellCandidate objects... I've stored array
> > references in Apache::Session before; is the problem my trying to save
> > the Objects, or the objects within an array Ref?
> 
> The problem is most likely that you are storing it two levels deep. 
> Apache::Session only saves when it sees that you have changed something,
> and it isn't seeing your change.  This is a common problem with tied
> objects, and there is a good explanation of it in the MLDBM
> documentation.  The Apache::Session docs say this:
> 
> "Note that Apache::Session does only a shallow check to see if anything
> has changed. If nothing changes in the top level tied hash, the data
> will not be updated in the backing store. You are encouraged to
> timestamp the session hash so that it is sure to be updated."
> 
> You could also just call the save method explicitly:
> tied(%session)->save()
> 
> > I know from it's docs that CGI::Session can store Objects - am I better
> > off switching to CGI::Session
> 
> They both use Storable for serialization.  The problem is the tie, not
> the serializer.
> 
> - Perrin
-- 
Brendan W. McAdams             | [EMAIL PROTECTED]
Senior Applications Developer  | (646) 375-1140
TheMuniCenter, LLC             | www.themunicenter.com

Reply via email to