Giles Hall wrote:
> Greetings,
> 
> I found a problem with SessionDynamicStore.  Here is the
> MovetoMemory() function at line 132.
> 
> def MovetoMemory(self, key):
>          self._lock.acquire()
>          try:
>                  global debug
>                  if debug: print ">> Moving %s to Memory" % key
>                  self._memoryStore[key] = self._fileStore[key]
>                  del self._fileStore[key]
>          finally:
>                  self._lock.release()
> 
> Notice how there are two calls to _memoryStore.__getitem__()?  The

I think you meant to say _fileStore.__getitem__ right?

> first is used to acquire the session object while the second is
> used to delete
> the session object out of _fileStore.  The consequence is that the
> pickled session object will be unpickled twice, which is not only
> unnecessary, but may cause hard-to-track-down logic errors.
> 
> A possible fix would be to create a method within _fileStore
> that will
> both recover and delete the pickled session data.  Comments?

Sounds like a good idea to me.  The method should be called "pop" because
that's the name of the dictionary method that does the same thing.

- Geoff


-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html
_______________________________________________
Webware-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-devel

Reply via email to