Using a SessionFactory in a WebLogic Cluster

If you’re trying to bind a Hibernate SessionFactory to a WebLogic cluster and you’re getting the following error message:

“Conflict start: You tried to bind an object under the name [{factory.name}] in the JNDI tree. The object from [{factory.name}] is non-clusterable, and you have tried to bind more than once from two or more servers. Such objects can only be deployed from one server.”

You may want to add this to you hibernate.cfg.xml file:

<property name="hibernate.jndi.weblogic.jndi.replicateBindings">false</property>

This has worked for me with WebLogic 8.1, and it is probably applicable to other WebLogic versions as well. While I haven’t come across any solid documentation which states that the SessionFactory is not a clusterable object, it appears that this is the case. This isn’t a big deal however, especially if you’re not using a second-level cache. If you need to use a second-level cache, you’ll want to use a cluster-aware cache such as JBoss Cache or Tangosol Coherence.

4 thoughts on “Using a SessionFactory in a WebLogic Cluster

  1. You can’t cluster the SessionFactory as I since. have learned. Therefore each node must manage it’s own SessionFactory. This is fine when the cache is clustered.

    Like

  2. You can’t cluster the SessionFactory as I since. have learned. Therefore each node must manage it’s own SessionFactory. This is fine when the cache is clustered.

    Like

  3. If you ARE using a second-level cache that supports clustering (i.e JBossCache) do you still need to cluster the SessionFactory? Or is it better to have each cluster node provide it’s own SessionFactory?

    Like

  4. If you ARE using a second-level cache that supports clustering (i.e JBossCache) do you still need to cluster the SessionFactory? Or is it better to have each cluster node provide it’s own SessionFactory?

    Like

Comments are closed.