Home > Hibernate > Using a SessionFactory in a WebLogic Cluster

Using a SessionFactory in a WebLogic Cluster

June 11th, 2006

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.

Share this Post:
  • del.icio.us
  • digg
  • DZone
  • Facebook
  • Identi.ca
  • LinkedIn
  • Reddit
  • TwitThis
Author: Ryan Categories: Hibernate Tags:
  • 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.
  • 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?
blog comments powered by Disqus
Buy bed in a bag bedding canopy bedding. Leather furniture furniture furniture sofas. discounted furniture furniture care discount furniture stores furniture showrooms kids furniture buy furniture online buy furniture kitchen furniture furniture shops