Hello Emmanuel,

That is weird.

Just a line above I have a code setting another attribute to the same
session and getting yet another attribute. It doesn't throw the NPE.
So, the session is nulled between two getAttribute calls from another
thread?

To make it more simple, here is the code:

session.setSetAttribute(foo, bar); => works
SomeClass c = (SomeClass) session.getAttribute(baz); => works
int var = (Integer) session.getAttribute(foobar); => fails with NPE

Do we need to check for null before any call to the session? Such
operation would not be atomic, so the check may not help at all.

It never happened before the latest April commits.


Thursday, April 9, 2009, 5:34:22 PM, you wrote:

E> No, it's enough.

E> Here, your session is null. You may have to check that in your
E> decoder. Now, the reason why the session has been "nulled" has to be
E> understood. AFAIK, even if the client brutally close the session, this
E> might happen. However, I think we should have a mechanism handling
E> such a case, like if there is a message being processed by this
E> session, then the session must be marked as 'closing', not set to
E> null.

E> I will try to look at this problem this evening...

E> In the mean time, a simple check on session could help...



-- 
Best regards,
 Serge

Reply via email to