SOLUTION: [ojb-users] ObjectCache and legacy applications
Brought to you by:
thma
From: Weaver, S. <Sw...@ri...> - 2002-04-22 17:14:33
|
> Another question is can I diasable ObjectCache all together? > I use JCS as my caching system so the ObjectCache is redundant > for me in many cases. We'll, I posted to soon. The soultion as quite simple after a little digging ;-) in OJB properties change the ObjectCacheClass to use ojb.broker.cache.MetaObjectCacheImpl: ObjectCacheClass=ojb.broker.cache.MetaObjectCacheImpl the code: <snip> try { MetaObjectCacheImpl ojbCache = (MetaObjectCacheImpl) ObjectCacheFactory.getObjectCache(); // Turn of caching for TscPrice ojbCache.setClassCache(TscPrice.class, null); } catch (ClassCastException cce) { String msg = "TscPricingService should only use the ojb.broker.cache.MetaObjectCacheImpl." + " This is due to the fact that caching MUST be turned off in OJB for the TscPrice class" + " in order for pricing to work correctly"; logger.error(msg); throw new InitializationException(msg); } </snip> preliminary test show that this is working. Regards, Scott |