Okay, backup a second..., you're doing this... why?  Do you need a
Math::Currency object stored inside the session?..., that could be quite a
hefty object.  See, everything you write to a session you have to read back in,
and any time you update any small part of it it has to re-write the whole
record.  What storage mechanism are you using for sessions, Filestore,
Database?  Generally I think it's a best practice to be careful about what
you're stuff in your sessions, i.e. how much data you're putting in there.  A
complete update of several objects could be pretty hairy since you have to do a
complete re-write of that record whenever you change one small detail.  You
also have to read in that entire session, and decompose it which could take a
little while.  Basically you're adding quite a bit of overhead to your
web-application.  Personally I like to keep my sessions really small, and put
more permanent data elsewhere, does anyone else have a "best practices" sort of
thing on what should/should not be stored in a session?  (This seems to come up
almost weekly I think)

Thanks,
Shane.
(Also you should read up on freeze thaw, because they can't store _everything_)

On Mon, 19 Jun 2000, you wrote:
> Hello,
>   I'm trying to use Math::currency with sessions, and I've run into a
> stumper.  I initialize variables and make them Math::Currency objects, and
> display them just fine, but when I come back (unthaw the session) instead
> of seeing the value I get the reference showing
> "Math::Currency=HASH(0x86b022)" instead of the value as it showed the
> first time through.
> 
> It's a reference going in, and a reference coming out, but for some reason
> it doesn't like being stuck into Apache::Session.
> 
> I can work around it by testing if it's a Math::Currency reference, and
> call Math::Currency->new.  But this seems a little silly.  Anyone seen
> this before?
> 
> Jay Jacobs

Reply via email to