We've got 2 servers in our cluster and we're using Hibernate 2.1.7c. We have three legacy databases sharing the same schema but with different data, so we have three SessionFactories. Currently, we have permission to use Ehcache, and JBossCache permission is pending but who knows when we'll be able to take it into use.
Thus we need a solution for using Ehcache in our cluster. This is what we came up with -- what do people think?
Deploy and configure ehcache on each server. Create an Interceptor that catches flushes, saves, and deletes and delivers an eviction notice JMS message to the other server node with the session factory identification, the object class, and object id. The other node then grabs the right session factory and evicts the object.
Sure, this comes under the category of "hack", especially when there are products like JBossCache and Tangosol Coherence available, but like I said, for the time being, we're stuck with ehcache.
Thoughts, comments?
|