In our application we want to be able to access the Session Context from classes other than the Session Bean itself. Specifically, we will have our business logic in separate classes, which will be called by the session beans; as well as Data Access Objects, which will be called by the business classes. Both will need access to the context from time to time.
We would rather not pass the context into all business classes and data object just for the few times we may need it. Is there a way to access the context without a reference to the session?
Assuming the answer is no, we will be creating a singleton which has a map of contexts. The context will be added when the session bean's business method is called, and removed when it finishes. The key would be the current thread. What problems might I run into with this system?
-
Access to Session Context (1 messages)
- Posted by: Bryan Young
- Posted on: July 02 2001 16:42 EDT
Threaded Messages (1)
- Access to Session Context by Aditya Anand on July 02 2001 17:01 EDT
-
Access to Session Context[ Go to top ]
- Posted by: Aditya Anand
- Posted on: July 02 2001 17:01 EDT
- in response to Bryan Young
I think in this scenario, the session context will be passed by refence rather than value...unless the helper classes are EJBs again... so passing the sessioncontext would be cheaper than using a singlton-lookup approach.