List Info

Thread: SessionDeadlockError - need to lock ? - when/best way ?




SessionDeadlockError - need to lock ? - when/best way ?
user name
2006-03-06 03:22:15
Hi - I've just generated a SessionDeadlockError error in
one of my
objects by (I think) requesting it from two different tabs
of the same
browser (more or less) simulataneously. The traceback is at
the end of
this post.

I'm aware that you can use cherrypy.session.acquire_lock()
to lock a
session but in this case I'm not actually updating a
session variable
(all I do with sessions is read the '_id') and the doco
suggests that
acquire_lock is only for when you're about to do an update.

So first off is locking going to help me ? If so am I right
in thinking
that cherrypy.session.acquire_lock() is the way to go ?

Thanks for any help ....The traceback looks like this ...

Traceback (most recent call last):
  File
"/usr/lib/python2.4/site-packages/cherrypy/_cphttptool
s.py",
line 265, in run
    applyFilters('beforeRequestBody')
  File
"/usr/lib/python2.4/site-packages/cherrypy/_cphttptool
s.py",
line 641, in applyFilters
    method()
  File
"/usr/lib/python2.4/site-packages/cherrypy/lib/filter/
sessionfilter.py",
line 131, in beforeRequestBody
    sess.sessionStorage.cleanUp()
  File
"/usr/lib/python2.4/site-packages/cherrypy/lib/filter/
sessionfilter.py",
line 316, in cleanUp
    self._lockFile(lockFilePath)
  File
"/usr/lib/python2.4/site-packages/cherrypy/lib/filter/
sessionfilter.py",
line 345, in _lockFile
    raise SessionDeadlockError()
SessionDeadlockError


regards

Richard.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at http://
groups.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )