I found this doc applicable
"You can pass the HttpSession as parameter to an EJB method, only if all objects in session are serializable. This has to be consider as passed-by-value, that means that it's read-only in the EJB. If anything is altered from inside the EJB, it won't be reflected back to the HttpSession of the Servlet Container"

More to the point of your test scenario:
The pass-by-reference can be used between EJBs Remote Interfaces, as they are remote references. While it is possible to pass an HttpSession as a parameter to an EJB object, it is considered to be bad practice in terms of object-oriented design. This is because you are creating an unnecessary coupling between back-end objects (EJBs) and front-end objects (HttpSession).

In any case could you post an the aforementioned where the session attributes are being modified so we can look at it..

Thanks/
M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- From: "Bill Barker" <[EMAIL PROTECTED]>
To: <users@tomcat.apache.org>
Sent: Friday, September 07, 2007 10:33 PM
Subject: Re: Concurrency with HttpSession



"lightbulb432" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]

I'm reading some book concurrency books that talk about potential thread
safety issues with HttpSession. Specific cases follow:

- When the web container passivates an HttpSession while a user's request
modifies it

Should be rare, but I don't see anything in the TC code to prevent it from happening on edge cases. If someone can construct an example, I'd be more than happy to look into it.

- When the web container replicates an HttpSession while a user's request
modifies it

I believe that with pessimistic locking, this shouldn't happen. But I'm not an expert on the TC replication code :).


- When multiple quick, successive requests from the same user access the
same HttpSession

Could somebody explain how Tomcat deals with the first two, and what steps web application developers need to take to avoid concurrency problems with
all three cases above? Is it guaranteed that the passivated/replicated
object is always a consistent view of the HttpSession?

Thanks.
--
View this message in context: http://www.nabble.com/Concurrency-with-HttpSession-tf4403264.html#a12561600
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to