I'm working on a J2EE application where the EntityBeans (EJB 2.1) are using the container configuration "Standard CMP 2.x EntityBean" which uses the locking-policy QueuedPessimisticEJBLock:
<container-configuration>
<container-name>Standard CMP 2.x EntityBean</container-name>
...
<locking-policy>org.jboss.ejb.plugins.lock.QueuedPessimisticEJBLock</locking-policy>
...
</container-configuration>
Also in the jbosscmp-jdbc.xml the EntityBeans are configured to use optimistic-locking:
<entity>
...
<optimistic-locking>
<modified-strategy/>
</optimistic-locking>
</entity>
Does it make any sense to use additional optimistic locking when the rows are locked anyway due to the QueuedPessimisticEJBLock locking policy?