jsr369-experts@servlet-spec.java.net

[jsr369-experts] Re: [servlet-spec users] Re: Data Structures and Session Replication

From: Greg Wilkins <gregw_at_intalio.com>
Date: Wed, 11 Feb 2015 17:59:16 +1100

On 11 February 2015 at 01:45, Mark Thomas <markt_at_apache.org> wrote:

> HttpSession.markAsDirty(String attributeName)


The problem with just adding a new method is that it essentially leaves the
undefined behaviour of setAttribute as is. If an application was not
calling markAsDirty() then we would not know if that was because it didn't
know about the API or was it written expecting some funky session that auto
detects deep object mutations.

If we really want to fix this, then perhaps we need modal behaviour: either
we work in the current ill defined API, where applications are essentially
tied to specific session implementations; or we enter a new mode with
precise portable cluster semantics - in which case we we may as well use an
entirely new API - or extension of the existing API.

To repeat myself in a different way, we could have two session mechanisms
behind the same JSESSIONID tracking. If you call request.getHttpSession()
you get the old ill defined session. If you call
request.getDistributedSession() then you'd get the well defined cluster
session. You could even call both if you wanted to have some session
information held on the node and other in the cluster.

I think any attempt to slip good semantics under the existing session API
is going to break as many applications as it fixes.

cheers

-- 
Greg Wilkins <gregw_at_intalio.com>  @  Webtide - *an Intalio subsidiary*
http://eclipse.org/jetty HTTP, SPDY, Websocket server and client that scales
http://www.webtide.com  advice and support for jetty and cometd.