Hi,

I' ve got a same problem, try to run "put" method in thread and for example
each 10 keys force thread to sleep for (for example 1ms). It's looks like
the disk is to slow to write all keys continuous, so jcs cache lose a keys
for that reason.

Regards,

Bodo

On 7/26/07, Johann Blauensteiner <[EMAIL PROTECTED]> wrote:
>
> Hi folks,
>
> I'm filling a region with 200.000 Key/Value-pairs from a ResultSet:
> Right after finishing the while-loop, most of the objects are gone (e.g.
> both System.outs return null for existing keys )
> Whats wrong??
>
> --- CODE
>
> ---------------------------------------------------------------------------------------
> JCS cache = null;
> cache = JCS.getInstance("cn2urCache");
> // GET RESULTSET
> ...
>
> while (rs.next()) {
>   String customerNumber = rs.getString("customernumber");
>   int userRid = rs.getInt("rid");
>   cache.put(customerNumber, userRid);
> }
> System.out.println(cache.get("10"));
> System.out.println(cache.get("161300"));
>
> --- CODE
>
> ---------------------------------------------------------------------------------------
>
>
> #########################################################################
> # DEFAULT CACHE REGION
> ##########################################################################
> jcs.default=DC
> jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
> jcs.default.cacheattributes.MaxObjects=100
>
> jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
> jcs.default.cacheattributes.UseMemoryShrinker=false
> jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3600
> jcs.default.cacheattributes.ShrinkerIntervalSeconds=60
>
> jcs.default.elementattributes=org.apache.jcs.engine.ElementAttributes
> jcs.default.elementattributes.IsEternal=true
> jcs.default.elementattributes.MaxLifeSeconds=-1
> jcs.default.elementattributes.IdleTime=1800
> jcs.default.elementattributes.IsSpool=true
> jcs.default.elementattributes.IsRemote=false
> jcs.default.elementattributes.IsLateral=false
>
> ##########################################################################
> # PRE-DEFINED CACHE REGION CustomerNumber2UserRidCache
> ##########################################################################
> jcs.region.cn2urCache=DCCn2urCache
>
> jcs.region.cn2urCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
> jcs.region.cn2urCache.cacheattributes.MaxObjects=100
>
> jcs.region.cn2urCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
> jcs.region.cn2urCache.cacheattributes.UseMemoryShrinker=false
> jcs.region.cn2urCache.cacheattributes.MaxMemoryIdleTimeSeconds=3600
> jcs.region.cn2urCache.cacheattributes.ShrinkerIntervalSeconds=60
> jcs.region.cn2urCache.cacheattributes.MaxSpoolPerRun=100
>
>
> jcs.region.cn2urCache.elementattributes=org.apache.jcs.engine.ElementAttributes
> jcs.region.cn2urCache.elementattributes.IsEternal=true
>
> ##########################################################################
> # AVAILABLE AUXILIARY CACHES DCCustomerNumber2UserRidCache
> ##########################################################################
>
> jcs.auxiliary.DCCn2urCache=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
>
> jcs.auxiliary.DCCn2urCache.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
>
> jcs.auxiliary.DCCn2urCache.attributes.DiskPath=c:/temp/jcs_swap/DCCustomerNumber2UserRidCache
> jcs.auxiliary.DCCn2urCache.attributes.MaxPurgatorySize=100
> jcs.auxiliary.DCCn2urCache.attributes.MaxKeySize=200000
> jcs.auxiliary.DCCn2urCache.attributes.MaxRecycleBinSize=100
> jcs.auxiliary.DCCn2urCache.attributes.OptimizeAtRemoveCount=300000
> jcs.auxiliary.DCCn2urCache.attributes.ShutdownSpoolTimeLimit=60
>
> Thanks !
> Johann
>
>


-- 
Ing.Bohuslav Mlynarčík
Tomášikova 54
080 01 Prešov

tel: +421 051 77 432 04
mobile: +421 0907230437

Reply via email to