1 Reply Latest reply on Jun 12, 2003 2:46 AM by Alexey Loubyansky

    Optimistic Lock

    regulus Newbie

      Hi, have anyone tried JDBCOptimisticLock in JBoss 3.2? I've added the line
      <locking-policy>org.jboss.ejb.plugins.lock.JDBCOptimisticLock</locking-policy> to container configuration (standardjboss.xml), but I'm keep getting this error:
      NullPointerException at ...
      JDBCOptimisticLock.schedule(...)

      Someone get an idea? Thanks

        • 1. Re: Optimistic Lock
          Alexey Loubyansky Master

          Specifying locking-policy is not enough. It needs additional configuration. You have to use custom container configuration.
          in jboss.xml:
          <container-configurations>
          <container-configuration extends="Instance Per Transaction CMP EntityBean">
          <container-name>Optimistic Container</container-name>
          <locking-policy>org.jboss.ejb.plugins.lock.JDBCOptimisticLock</locking-policy>
          </container-configuration>
          </container-configurations>

          And strategy in jbosscmp-jdbc.xml:
          ...
          <optimistic-locking>
          <version-column/>
          <field-name>versionField</field-name>
          <column-name>ol_version</column-name>
          <jdbc-type>INTEGER</jdbc-type>
          <sql-type>INTEGER(5)</sql-type>
          </optimistic-locking>


          You are on the wrong forum. You should ask such questions on user forums or on jboss-user mailing list.

          alex