jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Stibbs <stripybad...@gmail.com>
Subject Re: Guaranteed persistence
Date Wed, 04 Aug 2010 07:24:51 GMT
I am using CompositeCacheManager.getUnconfiguredInstance(); and configuring
it programatically with the following properties:

jcs.default=DC
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=0
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
jcs.auxiliary.DC=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
jcs.auxiliary.DC.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
jcs.auxiliary.DC.attributes.DiskPath=C:\path\etc
jcs.auxiliary.DC.attributes.MaxKeySize=1000
jcs.auxiliary.DC.attributes.OptimizeAtRemoveCount=1000

My main aims are:
- guaranteed persistence - once I've added it to the cache, even if the
application crashes, the key value pair will still be available when the app
starts up again
- a non-infinite cache - I want the number of items in the cache to not
exceed order of 1000 to conserve disk space, though the exact number is not
important.

Do these sound like something that is possible with JCS? I've looked through
all the documentation and can't find anything along these lines.

Thanks,

Tim.

On 3 August 2010 20:17, Jorge Medina <cerebrotecnologico@gmail.com> wrote:

> Look at :
> http://jakarta.apache.org/jcs/RegionProperties.html
> and
> http://jakarta.apache.org/jcs/IndexedDiskCacheProperties.html
>
> What are the properties of your disk cache ?
>
>
> On Mon, Aug 2, 2010 at 4:51 AM, Tim Stibbs <stripybadger@gmail.com> wrote:
> > Hi,
> >
> > 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).
> >
> > So, is there anyway to force the cache to immediately persist to disk?
> > Having MaxObjects=0 on the memory cache seems to help, but still doesn't
> > cause the .key file to be written.
> >
> > I also though I might be able to use ICacheEventLogger to see when data
> has
> > actually been written to the disk store, but the logging stuff doesn't
> seem
> > to be in the released version, although it is in the documentation?
> >
> > Does anyone know if it is even possible to do what I am trying to do, or
> > have any suggestions?
> >
> > Thanks.
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jcs-users-help@jakarta.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message