You shouldn't use CMP outside a transaction.
It is impossible for an application server to
distingish re-entrant from concurrent when
there is no transactional lock.
The deadlock issues are probably because you
are missing indexs for some of the contraints
in your DB. Oracle starts locking tables/whole columns
when there is no index.
We are experiencing the same problem. We recently upgraded JBoss to 3.2.1 and set all of our Entity Bean get methods to be read only. We are using TX REQUIRED on all of our Entity Beans and our Session Fascade that accesses them.
We now get a slew of Reentrant errors when running our concurrency load testing JUnit tests that we didn't get before. I sure would hate to have to move to reentrant EntityBeans just to work around this issue.
In our case this has absolutely nothing to do with Oracle indexes.
Can you show your jboss.xml,
even a read-only method will lock the bean instance
for the duration of the getXXX().
Setting reentrant won't help, you just move the
I figured out our problem. I had temporarily changed the lock-policy for all of our entity-beans to SimpleReadWriteEJBLock and forgot to swtich it back to QueuedPessimisticEJBLock. Once I put it back to QueuedPessimisticEJBLock the reentrancy errors went away.
Thanks for the response.