ps: i've modified my code to 1) only get once per request
and 2) set at the end of each request. the net effect is
that stuff works as expected. i'm reasonably happy with the
current state of affairs, but...
i don't like having to explicitly call set to force
modifications to be written to the cache, and i'd prefer
that get always return the same instance that i originally
set. can these issues be considered for a future version of
the interface? i see the need for the current behavior when
using file-based caches, but perhaps there's a way to
streamline operations for memory caches? perhaps Storable
can be bypassed for memory caches?
also, has there been any thought given to locking cached
items? when i'm using a shared cache with multiprocess
apache, the opportunity exists for multiple requests to
access a single session simultaneously, which can lead to
races. which i'm happy to ignore for now but would be nice
to eventually prevent.
On Sat, 4 Aug 2001, brian moseley wrote:
> On Sat, 4 Aug 2001, DeWitt Clinton wrote:
>
> > Can you check the actual data contained within the
> > object? If I understand things right, there is a chance
> > that the data itself is indeed the same. However, the
> > instance containing the data (in your case, an instance
> > of Wombat::Core::Session) will be different because it
> > is going through Storable's freeze and thaw during the
> > persistence process. Therefore a new instance is
> > created when you call get, but it is identical with
> > respect to the data to the one you stored with the set.
>
> the data is definitely different. i am using a simple
> servlet that allows me to specify a name and value to be
> bound into the session. when i reload the page, however, the
> name and value are no longer bound into the session. also,
> on each request, the session's last accessed time is updated
> after the first get, but after the second get i see the
> original time, not the updated one.
>
> could this be because i'm only ever doing one set, at
> session creation time? since i'm using a memory cache, i
> didn't expect to have to call set every time i modify the
> cached data.
>
> also i didn't know that Storable was used underneath. why is
> this necessary?
>