NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: [netcdf-java] Persisting a NetcdfDatasetCache

Hi Nick,

Oh wait, I just read the last sentence of your post properly, sorry ;-)

> I'm using EHCache with persistent filesystem backend to recall
> non-Serializable objects between JVM restarts in non-Netcdf software.

How are you doing this?  According to the ehcache documentation at
http://ehcache.sourceforge.net/documentation/storage_options.html:

"Only Elements which are Serializable can be placed in the DiskStore.
Any non serializable Elements which attempt to overflow to the
DiskStore will be removed instead, and a WARNING level log message
emitted."

Perhaps the ehcache docs haven't kept up with the software (although I
still can't imagine how non-serializable objects can be persisted...)

Cheers, Jon

On Feb 18, 2008 8:28 AM, Jon Blower <jdb@xxxxxxxxxxxxxxxxxxxx> wrote:
> 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
> --------------------------------------------------------------
>



-- 
--------------------------------------------------------------
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: