1 Reply Latest reply on Nov 18, 2009 10:58 AM by Brian Stansberry

    obtain cluster lock

    nie feng Newbie

      Hi all,

      Could I know what will be the available option for us to ensure that no two md bean instance reside in different cluster node accessing the same shared resources?

      The current approach i have identified is using the Hibernate LockMode.UPGRADE_NOWAIT. Whenever the md bean access the shared resource, it will acquire the lock via LockMode.UPGRADE_NOWAIT.

       Thus whenever the following error happened , it signal that other md bean instance in different cluster node is accessing.
      org.hibernate.exception.LockAcquisitionException: could not execute query
       at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:87)
       at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
       at org.hibernate.loader.Loader.doList(Loader.java:2147)

      Is the above mentioned approach recommended? Or any other mechanism is better in this scenario? Thanks!

      My deploy env
      JBOSS 405
      oracle 10