webware-discuss

Hi,
I'm trying to implement a per-session data store for WebKit and this is
what I've done so far (in the attachment).
It is used like this:
store.register('dc', newDebuggingContext)
store.register('localizer', newLocalizer)
class SitePage:
...
def awake(self, t):
mvc.View.awake(self, t)
SID = self.session().identifier()
try:
self.localizer = store.get(SID, 'localizer')
except cms.config.Error, e:
self.localizer = NoOpLocalizerStub()
self.handleError("Can't create localizer", e)
self.debugContext = store.get(SID, 'dc')
The questions:
1. Should I guard the class with threading locks?
2. How can I (if I can) get notified when the session is abandoned to be
able to free resources from store?
3. Would it be feasible to manage the db conn. the same way?