Running multiple applications using hibernate with a single standalone EhCache server -


i have 2 app servers (in case tomcat needn't container) running same application load balancer directing work them.

behind these servers have single database both servers wish connect via hibernate. want cache common object requests using ehcache. in single server setup trivial configuration change hibernate use ehcache provider.

however, don't want each server have own cache, think want central cache both servers use.

originally, thought simple matter of setting standalone ehcache server , pointing hibernate configuration @ them. however, have been unable identify how can performed (if @ all).

my questions are: can setup exist , how 1 set up?

if isn't possible, there other way (or other caching provider) in maintain common hibernate cache between applications?

i not aware of ehcache server can accessed several machines. might write , expose e.g. rest api, have implement own cacheregionfactory hibernate use remote server behind scenes. lot of work , result unsatisfactory due network latency.

another approach have shared cachemanager can used several application within 1 jvm. since have several jvms, not option. requires ehcache.jar laoded once parent class-loader since uses simple static field preserve single instance.

finally, answer question either using cache replication or terracotta. while terracotta sophisticated product, ehcache cache replication mature , stable.

the idea simple: each server has independent instance of cache manager, cache managers discovering automatically using udp , network broadcast. when change occurs in 1 of caches, propagated other peers. not scalable, 2 server should work fine.


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -