Hi.
I'd like to know how to retain objects across requests. I tried using singleton classes, but I think values stored in a singleton class are accessible to all users. I need to retain objects that are specific to a particular user, across different calls by that user.
I am aware of how to use Stateful Session Beans to achieve this. This can also be done by serializing the object and persisting to the disc. But I am looking for a simpler solution. Any help in this regard is appreciated. Thanks in advance.
-Parag Desai
-
Retaining objects across requests (5 messages)
- Posted by: Parag Desai
- Posted on: August 26 2004 06:30 EDT
Threaded Messages (5)
- Retaining objects across requests by Rob Misek on August 26 2004 09:47 EDT
- Using init() by Thierry Danard on August 26 2004 22:59 EDT
- Retaining objects across requests by Parag Desai on September 23 2004 10:34 EDT
- Retaining objects across requests by Rob Misek on September 23 2004 13:27 EDT
- Retaining objects across requests by Parag Desai on September 28 2004 06:36 EDT
-
Retaining objects across requests[ Go to top ]
- Posted by: Rob Misek
- Posted on: August 26 2004 09:47 EDT
- in response to Parag Desai
Hi Parag,
How about using the HTTP session object?
Later,
Rob Misek
Tangosol, Inc.
Coherence: It just works. -
Using init()[ Go to top ]
- Posted by: Thierry Danard
- Posted on: August 26 2004 22:59 EDT
- in response to Parag Desai
Just create an object in your servlet class that you instantiate in the init() method. However, be sure to synchronize the "write" access to this object. If you modify this object very often, this is not a good solution as it will create a bottleneck. -
Retaining objects across requests[ Go to top ]
- Posted by: Parag Desai
- Posted on: September 23 2004 10:34 EDT
- in response to Parag Desai
Sorry for getting back so late... Yes, using the Session is the most obvious way, but the Session memory has been limited to ONLY 2Kb per user for my application (!!!). So I cannot use that approach. Some people mailed me saying I could write out the values to hidden fields on the JSP and get them through the HTTP Request in my Action class (Btw my application uses Apache Struts). I cannot do this either because what I want to save, is an Object, not just a String. Hope I'm not bugging too you too much.
-Parag -
Retaining objects across requests[ Go to top ]
- Posted by: Rob Misek
- Posted on: September 23 2004 13:27 EDT
- in response to Parag Desai
Hi Parag,Yes, using the Session is the most obvious way, but the Session memory has been limited to ONLY 2Kb per user for my application (!!!). So I cannot use that approach.
Are you running in a clustered environment? If so, you may want to check out Coherence*Web for your HTTP session management. Coherence*Web allow for linear scalable performance of HTTP sessions with no single point of failure or bottleneck. Also, there is on limit to the size of the session object.
Later,
Rob Misek
Tangosol, Inc.
Coherence: It just works. -
Retaining objects across requests[ Go to top ]
- Posted by: Parag Desai
- Posted on: September 28 2004 06:36 EDT
- in response to Parag Desai
Nopes, Rob. Not a clustered envmt. Standalone IBM WebSphere App Server, if that makes any difference. I'm currently doing away by serializing and writing the object into a temporary DB table. But I'd be glad to know anything better.
-Parag