jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niall Gallagher <ni...@switchfire.com>
Subject Re: Disable JCS Cache by commenting region in cache.ccf
Date Tue, 10 Feb 2009 13:49:10 GMT
Hi gopalnb,



Kind regards,


-----Original Message-----
From: gopalnb <gopalnabble@mykbl.com>
Reply-to: "JCS Users List" <jcs-users@jakarta.apache.org>
To: jcs-users@jakarta.apache.org
Subject: Disable JCS Cache by commenting region in cache.ccf
Date: Tue, 10 Feb 2009 05:37:11 -0800 (PST)

I need test the effectiveness of JCS caching with some of the java objects
that are otherwise always fetched from the DB in my Java application (e.g.
StateVO {CD, Name}). 

How should I configure the "# DEFAULT CACHE REGION" section of my cache.ccf
so that if a region is not explicitly defined in the cache.ccf, no caching
for that object would occur? I believe there should be some option by which:
if I comment out a particular pre-defined cache region in the cache.ccf, no
caching would occur for that object, without any change in the java code. 

I tried the following: 

JCS cache = null;
String cacheRegionName = "state";
cache = JCS.getInstance(cacheRegionName);

String getState(stateCode) {
StateVO state = (StateVO) getCache().get(stateCode);
  if (state == null) {
    state = dao.getState(stateCode);
    cache.put(stateCode, state);

The StateVO objects are being cached and retrieved from the cache
irrespective of whether the "state" region is pre-defined in the cache.ccf.

What needs to be done so that the above objects would not be cached if I
comment out the state region?

I saw someone mention a "nocache" or "NOPCache" option - but could not find
the source or documentation supporting that. Any pointers?

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