There is one deadlock we don't detect.
The RequiresNew self deadlock.
We cannot detect deadlocks we don't know about,
e.g. contraints in the database (without supporting indexes)
can hold locks other than the row lock.
What database isolation do you have?
> There is one deadlock we don't detect.
> The RequiresNew self deadlock.
That was it. Thanks!
I've had this problem too, I changed my code, so I never use RequiresNew.
It would never timeout for me either, is this a fault of my db driver or JBoss? Do I have to set up my database to timeout?
Will this deadlock occur only under certain conditions?, or can you expect it to happen anytime RequiresNew is used ?
(i.e. can you write your code using RequiresNew in such a way that you are guaranteed to never see this deadlock)
Ensure you never invoke a method with RequiresNew when the
entity instance is already locked to the current transaction.
bean.doSomething(); // Locks bean to current transaction
bean.doSomethingWithRequiresNew(); // Cannot lock the bean
Of course the code is never that simple to spot. :-)