Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Cleaning up state info  RSS feed

 
srinivasan ganesan
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36406
454
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!