tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <ch...@christopherschultz.net>
Subject Re: Distributable contexts and non-serializable session attributes
Date Mon, 11 Jul 2011 14:43:45 GMT
Rainer,

On 7/10/2011 3:38 PM, Rainer Jung wrote:
> Unfortunately I stumbled into some code in StandardSession:
> 
> public void setAttribute(String name, Object value, boolean notify) {
> ...
> if ((manager != null) && manager.getDistributable() &&
>   !(value instanceof Serializable))
>     throw new IllegalArgumentException
>         (sm.getString("standardSession.setAttribute.iae", name));
> ...
> }
> 
> This means if you enable "distributable", then you can no longer set any
> non-serializable session attribute. The code is not recent, it goes back
> to at least TC 3.3.
>
> I think checking for serializability in StandardSession isn't good,
> because AFAIK StandardSession isn't used by any mechanism Tomcat
> supports to implement "distributable".
> 
> And in DeltaSession I would like to have the check optional, i.e. only
> check if the configuration wants the attribute to be replicated.
> 
> By default all attributes will be replicated as is today, but by
> configuration one will be able to choose attributes to replicate using a
> regexp against the attribute name.

+1

-chris


Mime
View raw message