You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Jon Stevens <jo...@latchkey.com> on 2001/07/10 05:44:11 UTC

[t4] StandardSession.readObject()

Shouldn't it call setAttribute(name, value) instead of:

            synchronized (attributes) {
                attributes.put(name, value);
            }

?

-jon


Re: [t4] StandardSession.readObject()

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Mon, 9 Jul 2001, Jon Stevens wrote:

> Shouldn't it call setAttribute(name, value) instead of:
> 
>             synchronized (attributes) {
>                 attributes.put(name, value);
>             }
> 
> ?
> 

If it did, the session event listeners and HttpSessionBindingListeners
will get called more than once for the same attribute -- once when you
originally added it, and once for each time you reload the application.  
That doesn't seem like the right thing to do, since (as far as the app is
concerned), persisting and reloading should be transparent.

> -jon
> 
> 

Craig