1 Reply Latest reply on Jun 28, 2003 5:05 AM by Grzegorz Stelmaszek

    Optimistic Locking

    freiburg Newbie

      Hello to all,
      I'd like to know how I can set jboss for using Optimistic locking instead of pessimistic locking as default. Which xml files I have to modify? Which tags I have to write?
      Thank you very much,
      Andrea

        • 1. Re: Optimistic Locking
          Grzegorz Stelmaszek Newbie

          Hi,

          In you standardjboss.xml put:
          ---
          <locking-policy>org.jboss.ejb.plugins.lock.JDBCOptimisticLock</locking-policy>
          ---
          instead of the
          ---
          <locking-policy>org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock</locking-policy>
          ---

          You must also define strategy for the locking in either deployement destriptor or in standardjbosscmp-jdbc.xml:
          ---
          <optimistic-locking>
          <modified-strategy/>
          </optimistic-locking>
          ---
          you can choose of a few strategies (look into jbosscmp-jdbc_3_2 under jboss/docs/dtd directory).

          I'm testing this optimistic thing now, and unfortunetally I must say that I get plenty of 'Reentrant method call detected' errors :(.

          best regards,
          greg