jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johann Blauensteiner" <jblauenstei...@pidas.com>
Subject jcs.get() returns null
Date Thu, 26 Jul 2007 12:54:54 GMT
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


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