0 Replies Latest reply on Feb 9, 2007 9:54 AM by Amin Lalji

    Hibernate SessionFactory w/ JBossAS Cluster

    Amin Lalji Newbie


      I am trying to understand the operation of hibernate in a clustered JBoss environment.

      Consider the following setup:

      2 JBossAS servers (load balanced vis mod_jk2) using Hibernate for persistence w/ JBossCache enabled.

      Scenario 1: SERVER1 decides to act upon an object and works with it in cache. The JBossCache notifies all other caches that exist on other cluster nodes of any changes (really just sends invalid/expire notifications). Everything remains in sync... I think. What happens if SERVER2 also concurrently decides to act upon the same object? I assume the isolation level configured in the SessionFactory has a role to play in determining the resultant behaviour (and I assume the isololation levels should also match) to keep things in sync.

      The alternative to this scenario is using a "clustered" SessionFactory that is shared by all nodes of the cluster (via JNDI) ... I'm not sure which scenario described above is A) Valid, and B) Best Practice and C) even Possible...

      Any ideas?