Forums Register Login

Cleaning up state info

+Pie Number of slices to send: Send
We have implemented a Stateful Session Beans that uses a HashMap to maintain some state information (info about the client). If the client leaves the site before his session expires and never returns, the info from the cache is never removed and stays there until the garbage collection is run. If the client does come back to finish his/her activity, we clean it up programmatically.
Does anyone have any suggestions as to how to clean up the data (from the clients that do not return) from the cache?

I would like to know if wepshere provides a cleanup service of some sort to take care of this or would we have to write the cleanup service ourselves and run it perhaps once a day..

Thanks,
Srini
+Pie Number of slices to send: Send
Srini,
You could use a timeout value for each cache entry.

Take a look at WebSphere's command caching if you are on WAS 5 or above. It handles a lot of the details for you.
Everyone is a villain in someone else's story. Especially this devious tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 414 times.
Similar Threads
caching business delegate reference
Design problem
HttpSession scalability?
Stateless Session Bean Problems Singleton
garbage collection listener for cache cleanup
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 13:32:38.