You could set the purgatory size to greater than the number you plan to insert, 
but I doubt that you have that much memory.

What you want is probably to make the puts synchronous.  That is, you'd like 
the thread doing the inserts to wait until the insertion is complete to return 
(if the buffer is full).  To do this, you can configure the disk cache to use a 
pool type event queue.  Configure the pool to use a queue and set the when full 
policy to RUN.  

http://jakarta.apache.org/jcs/IndexedDiskCacheProperties.html

There is another property of the thread pool called "whenBlockedPolicy" that is 
not on the site docs.  Set it to "RUN".

Aaron


--- On Tue, 7/29/08, Olivier Toromanoff <[EMAIL PROTECTED]> wrote:

> From: Olivier Toromanoff <[EMAIL PROTECTED]>
> Subject: Disk cache is missing entries
> To: jcs-users@jakarta.apache.org
> Date: Tuesday, July 29, 2008, 4:46 AM
> Hi,
> 
> I am currently trying to integrate JCS into a project
> mainly for its 
> disk based caching functionalities.
> 
> When the software starts up, I put a lot (few millions)
> entries into the 
> cache.
> These entries will never change and will be accessed at
> runtime.
> 
> The problem that I have, is that some entries are missing
> when I try to 
> get them.
> 
> I read on this mailing list that it could be caused by the
> purgatory 
> that could discard some entries before to store them to the
> disk when 
> the queue becomes too long.
> What would be the best configuration/best usage to solve
> this issue?
> And if you think it is caused by something else, how can I
> prevent it?
> 
> Here is my current configuration:
> 
> # DEFAULT CACHE REGION
> # sets the default aux value for any non configured caches
> jcs.default=DC
> jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
> jcs.default.cacheattributes.MaxObjects=5000
> jcs.default.cacheattributes.DiskUsagePatternName=UPDATE
> jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
> jcs.default.elementattributes.IsEternal=true
> 
> # CACHE REGIONS AVAILABLE
> # Regions preconfigured for caching
> jcs.region.mainregion=DC
> jcs.region.mainregion.cacheattributes.MaxObjects=1200
> 
> # AUXILIARY CACHES AVAILABLE
> # Primary Disk Cache -- faster than the rest because of
> memory key storage
> 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=data/caches
> jcs.auxiliary.DC.attributes.MaxKeySize=-1
> 
> 
> Thanks,
> Kind regards,
> Olivier.
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to