Re: Cache Issue in distributed environment

Armin Waibel <[email protected]> Wed, 12 Mar 2008 23:34:21 +0100
Newsgroups gmane.comp.jakarta.ojb.user
Message-ID <[email protected]>
Armin Waibel wrote:
>> I don't find information to configure it with OJB. Can
>> anybody help me ?
> 
> If you use OJB 1.0.5rc1 change the object-cache element within your 
> jdbc-connection-descriptor to
> 
> one global cache region:
> <object-cache class="JCS">
> </object-cache>
> 
> a cache region for each class:
> <object-cache class="JCSPerClass">
> </object-cache>
> 
> For version 1.0.4 specifiy the full qualified class name (e.g. 
> org.apache.ojb.broker.cache.ObjectCacheJCSPerClassImpl).
> 
> You can configure the JCS cache via the cache.ccf properties file.

Sorry, I have to clarify my last post.
I would recommend to use the two level cache with the distributed cache 
as second level cache.
If you use OJB 1.0.5rc1:

<object-cache class="twoLevel">
     <!-- ObjectCacheTwoLevelImpl attributes -->
     <attribute attribute-name="applicationCache" attribute-value="jcs"/>
     <attribute attribute-name="copyStrategy" attribute-value="default"/>
     <attribute attribute-name="forceProxies" attribute-value="false"/>
</object-cache>

OJB 1.0.4:

<object-cache class="org.apache.ojb.broker.cache.ObjectCacheTwoLevelImpl">
     <!-- ObjectCacheTwoLevelImpl attributes -->
     <attribute attribute-name="applicationCache" 
attribute-value="org.apache.ojb.broker.cache.ObjectCacheJCSImpl"/>
     <attribute attribute-name="copyStrategy" 
attribute-value="org.apache.ojb.broker.cache.ObjectCacheTwoLevelImpl$CopyStrategyImpl"/>
     <attribute attribute-name="forceProxies" attribute-value="false"/>
</object-cache>

regards,
Armin