1 Reply Latest reply on Apr 27, 2003 10:00 AM by slaboure

    JNDI context access syncronization

    sysuser1

      Hi,

      As far as I understand, to move an existing JSP/Servlet/JavaBeans beased application into distributed environment, I need to put all existing static variables (or a singleton objects properties) into JNDI (as Serializable data objects) to make them replicated/accessible to all nodes in the cluster.

      I would like to ask if there is a possibility to get some kind of distributed lock similar to standard java synchronization ?

      like this:
      -------
      getLock(initialContext,"JNDI name")

      x = initialContext.lookup(...)

      modifyObject(x) ...

      initilaConext.bind(...)

      releaseLock(initialContext,"JNDI name")
      -------

      Thank you,

      Vitaliy.

        • 1. Re: JNDI context access syncronization
          slaboure

          no, you have to implement it yourself or use "basic" classes available in JavaGroups. You can also simply use JBoss clustering framework HAPartition and make RPC call to the master node that will then be the locking node. In short, nothing is there by default.

          Cheers,


          sacha