Guys,

  I am not sure if I missed anything or not, but it
looks to me that caching is disabled in
svc-persist-default by default. Following is what I
did to enable it. Anything comments are welcome!
Correct me if I am wrong.

  First let me explain what I think, I Look at
DefaultPersistentBase.retrieveFromCache(), it calls 
isCached(), which use "if (myMetaData.getCacheSize() >
0)" to test if the cache is enabled. And in
AbstractPersistentMetaData, a member "cacheSize" is
defined (default value=0) but not changed anywhere
(because it's a private member and no setter is
provided). Therefore, the function
DefaultPersistentBase.retrieveFromCache() will always
think that caching is disabled for all persisitents.

To enable caching, I added a line in
AbstractPersistentMetaData.configurePersistent() as

cacheSize=
myConfig.getAttributeAsInteger("cache-size", 0);

then in system.xconf, we can enable caching by
defining as following

 <default-persistent id="default">
  <schemas id="default">
      <schema id="myschema">
       <persistent id="mytable" name="mytable"
cache-size="1"/>
      </schema>
</schemas>
</default-persistent>

Also, I think the "cache-size" here is just an on/off
switch, it doesn't mean the size of the cache at all.

I'll be glad to hear what you guys think.

btw, there is a minor bug fix in 
DefaultPersistentBase.java, function addToCache(),
there is online line read

Persistent newObj = create(
thisObj.getMetaData().getSchemaName()
+ "."
+ thisObj.getName());

The correct fix should be

Persistent newObj = create(thisObj.getName());

because getName() is returning "schema.name" already


                
__________________________________ 
Do you Yahoo!? 
Check out the new Yahoo! Front Page. 
www.yahoo.com 
 

http://keelframework.org/documentation
Keelgroup mailing list
[EMAIL PROTECTED]
http://lists.keelframework.com/listinfo.cgi/keelgroup-keelframework.com

Reply via email to