openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "LYALIKOV, Oleg (Oleg)" <oleg.lyali...@alcatel-lucent.com>
Subject openjpa and distributed ehcache
Date Fri, 09 Nov 2012 14:40:24 GMT
Hello,

I want to replicate OpenJPA (2.0.0) cache through AMQP (e.g. through RabbitMQ) and I see 2
possible ways:
1) Use implementation of RemoteCommitProvider for AMQP - as far as I know there are no any
public implementations
2) Use ehcache and its AMQP replication (there is one https://github.com/jamescarr/ehcache-amqpreplication
)

I've tried the second option and it doesn't work from the box - my "update" events haven't
replicated between JVM's.
It seems that the reason is in AbstractDataCache::recacheUpdates method which tells not to
update cache if updated object is already in cache. And it seems this option is not configurable
(hardcoded "return false"). And from openjpa-ehcache package (http://ehcache.org/documentation/integrations/openjpa-provider)
EhCacheDataCache class also doesn't override this method.

As possible solution I can inherit EhCacheDataCache, override recacheUpdates method + I need
to override some code in EhCacheDerivation so that my cache is used instead of EhCacheDataCache
(I haven't found a way how I can configure to use own cache implementation) - so it doesn't
look as proper solution for me (though it seems it works fine).

Could you provide please some ideas on what is the best solution in my situation? In the best
case I would prefer not to write/override any code and only make some configuration changes.

Regards,
Oleg


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