• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Cleaning up state info

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic