0 Replies Latest reply on Aug 6, 2006 12:11 PM by Anil Pathak

    Locking and synchronization

    Anil Pathak Newbie

      This quistion has been raised several times. Every such issue is answered in relation
      with database . How do i implement this simple locking in EJB 2.x
      Stateless Session bean

      My EJB is not intended to run in Cluster. Can i voilate the EJB spec by defining static
      field and synchronized block in EJB.


      My Hypothetical stateless session bean.
      Bean {
      private static Object LOCK = new Object();
      public void abcDef(){
      synchronized(LOCK) {
      ... // Nothing to do with database
      }
      }
      }

      Thanks for your pointer or suggestion.

      Regards,
      Anil Pathak