Re: [netcdf-java] Persisting a NetcdfDatasetCache

Hi Nick,

Thanks for this.  Unfortunately unless NetcdfDataset becomes
Serializable then persistence to disk will not be possible with
ehcache (non-serializable object caching only works for in-memory
caches).  Another option of course would be to persist to a (perhaps
embedded) database with Hibernate or similar.  However, I think the
simplest option would be to make NetcdfDataset serializable and use
ehcache or even something ad-hoc.

Cheers, Jon

On Feb 18, 2008 6:21 AM, Nick Bower <nick.bower@xxxxxxxxxxxxxxxxxxxxx> wrote:
> I was curious seeing this post and so noticed the NetcdfDatasetCache
> just now.
>
> Depending on what Jon says, I'm guessing there may be 2 options for
> integration here?
>
> 1) simply persisting cache state (thus reloading datasets on restart)
> 2) persisting cached objects properly by looking into changing
> NetcdfDatasetCache.cache from an ArrayList to an instance of EHCache's
> CacheManager.  Just have to try it and see as NetcdfDataset is not
> serializable although EHCache specifically deals with non-serializable.
>
> I'm using EHCache with persistent filesystem backend to recall
> non-Serializable objects between JVM restarts in non-Netcdf software.
>
>
>
> Jon Blower wrote:
> > Hi,
> >
> > My server application (ncWMS) uses the NetcdfDatasetCache as an
> > in-memory store of metadata to increase performance and reduce the
> > need to continually reload metadata from files.  It would be really
> > useful if I could persist the cache to disk so that the metadata is
> > available following a server restart (saves trawling through all the
> > data files again).
> >
> > Is it possible to save the contents of a NetcdfDatasetCache to disk?
> > I notice that it isn't marked Serializable.
> >
> > Cheers, Jon
> >
> >
>
>
>



-- 
--------------------------------------------------------------
Dr Jon Blower              Tel: +44 118 378 5213 (direct line)
Technical Director         Tel: +44 118 378 8741 (ESSC)
Reading e-Science Centre   Fax: +44 118 378 6413
ESSC                       Email: jdb@xxxxxxxxxxxxxxxxxxxx
University of Reading
3 Earley Gate
Reading RG6 6AL, UK
--------------------------------------------------------------


  • 2008 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdf-java archives: