Context-#session

Chris Muller chris at funkyobjects.org
Tue Sep 12 01:44:54 UTC 2006


> The problem that I have is that pier saves its history by saving its
> instances of PRContext', namely the context of the model changing
> command being performed. This context happens to have a local cache
> in
> it's properties the seaside session ('to avoid unneccessary
> lookups'),
> which if it is WAMagmaSession has a magmaSession instance var.
> 
> Now I could attempt to clear this cached value out before persistence
> takes place, but I see no guarantees that some other bit of code may
> reference the session and repopulate the cached value while I am not
> looking.

Hi Keith, could the MagmaSessions #location help here?  The #location
gives you a MagmaLocation which was intended for this purpose; it can
be serialized/materialized, and let you get a #newSession any time. 
You could clear the cached value before persistence and change its
getter to lazy initialize it from the location..?

 - Chris

--- Keith Hodges <keith_hodges at yahoo.co.uk> wrote:

> In trying to implement MagmaPersistency it turns out that the fact
> that
> PRContext holds a local cache to the current session may be a bit of
> a
> pain. Not only may there be a lot more stuff accidentally persisted
> through this reference, there may actually be objects that magma
> gurus
> say 'don't persist these if you know what is good for you'.
> 
> I cant see that this cache is widely used, so I wondered if anyone
> would
> object if it was removed
> 
> i.e. make this method lookup the current session the hard but not all
> that slow way (about 100 microseconds, on my oldish 700Mhz machine)
> 
> PRContext>>session
> 
> ^ WACurrentSession value
> 
> any thoughts/opinions?
> 
> Keith
> 
> 
> 
> 		
> ___________________________________________________________
> The all-new Yahoo! Mail goes wherever you go - free your email
> address from your Internet provider.
> http://uk.docs.yahoo.com/nowyoucan.html
> _______________________________________________
> Magma mailing list
> Magma at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/magma
> 
> 
> 



More information about the Magma mailing list