Hi Tim,

Try setting your MaxPurgatorySize to 0 so there is no asynchronous
caching of data written to the disk cache, it will reduce your
performance but means your data goes straight to disk. 

jcs.auxiliary.DC.attributes.MaxPurgatorySize=0

Purgatory
Writing to the disk cache is asynchronous and made efficient by using a
memory staging area called purgatory. Retrievals check purgatory then
disk for an item. When items are sent to purgatory they are
simultaneously queued to be put to disk. If an item is retrieved from
purgatory it will no longer be written to disk, since the cache hub will
move it back to memory. Using purgatory insures that there is no wait
for disk writes, unecessary disk writes are avoided for borderline
items, and the items are always available



-----Original Message-----
From: Tim Stibbs [mailto:stripybad...@gmail.com] 
Sent: 04 August 2010 08:25
To: JCS Users List
Subject: Re: Guaranteed persistence

I am using CompositeCacheManager.getUnconfiguredInstance(); and
configuring
it programatically with the following properties:

jcs.default=DC
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttribut
es
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.IndexedDiskCacheF
actory
jcs.auxiliary.DC.attributes=org.apache.jcs.auxiliary.disk.indexed.Indexe
dDiskCacheAttributes
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 <cerebrotecnolog...@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 <stripybad...@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-unsubscr...@jakarta.apache.org
> For additional commands, e-mail: jcs-users-h...@jakarta.apache.org
>
>

This message and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you have received this message in error please delete it and any files 
transmitted with it, after notifying postmas...@uk.mizuho-sc.com 
Any opinions expressed in this message may be those of the author and not 
necessarily those of the company. The company accepts no responsibility for the 
accuracy or completeness of any information contained herein. This message is 
not intended to create legal relations between the company and the recipient. 
Recipients should please note that messages sent via the Internet may be 
intercepted and that caution should therefore be exercised before dispatching 
to the company any confidential or sensitive information. 
Mizuho International plc Bracken House, One Friday Street, London EC4M 9JA. 
TEL. 020 72361090. Wholly owned subsidiary of Mizuho Securities Co., Ltd. 
Member of Mizuho Financial Group. Authorised and regulated by the Financial 
Services Authority. Member of the London Stock Exchange. 

Registered in England No. 1203696. Registered office as above.


---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscr...@jakarta.apache.org
For additional commands, e-mail: jcs-users-h...@jakarta.apache.org

Reply via email to