Thanks Thomas, it is a webapp, and thanks for the link, but I am concerned about the case where the webapp terminates abnormally - e.g if the physical machine crashes - in which case I can't rely on any kind of shut down hooks running.
Cheers, Tim. On 8 August 2010 17:11, Thomas Vandahl <t...@apache.org> wrote: > On 02.08.10 10:51, Tim Stibbs wrote: > > I am looking into using JCS as a disk-based key-value store, and it seems > to > > work fine. However if the jvm is terminated, the .key file may not get > > written to, and although the .data file has my data in, when I restart > the > > application it cannot access anything in the cache (presumably due to the > > .key file being empty). > > If you shut down your cache manager in an orderly fashion (dispose()), > the .key file will be written to disk. In a general application, a > shutdown-hook would be a good place to do this. If your application is a > web application, see > > http://jakarta.apache.org/jcs/apidocs/org/apache/jcs/utils/servlet/JCSServletContextListener.html > for an alternative. > > Bye, Thomas. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: jcs-users-unsubscr...@jakarta.apache.org > For additional commands, e-mail: jcs-users-h...@jakarta.apache.org > >