You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Colin Paul Adams <co...@colina.demon.co.uk> on 2004/07/09 13:49:26 UTC

Berkeley DB XML (Was: Session Timeout listener)

>>>>> "Sylvain" == Sylvain Wallez <sy...@apache.org> writes:

    Sylvain> Or you can also add store in a session attribute an
    Sylvain> object implementing
    Sylvain> javax.servlet.http.HttpSessionBindingListener that will
    Sylvain> be called whenever the session expires. This allows to
    Sylvain> perform any cleanup that you need.

    Sylvain> Remember however, that holding costly resources like DB
    Sylvain> connections between request is generally considered bad
    Sylvain> practice in webapps, because of this very problem of
    Sylvain> detecting that a user has left.

I don't see why it should be considered bad practice.
If you set a session timeout, then it's just a case of balancing the
amount of time needed for a user to reasonably complete a transaction,
against the extra memory used.
Of course, it won't scale terribly well, but under the conditions
assumed for optimistic locking, this can't be a problem anyway. And
this is a much more user-friendly approach then optimistic locking.

But rather than use HttpSessionBindingListener, I've decided to use
Berkeley DB XML.
Anyone any experience of this with Cocoon?
-- 
Colin Paul Adams
Preston Lancashire