-
1. Re: Deadlock not detected?
adrian.brock Oct 10, 2003 5:22 AM (in response to natemc)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?
Regards,
Adrian -
2. Re: Deadlock not detected?
natemc Oct 10, 2003 5:57 PM (in response to natemc)> There is one deadlock we don't detect.
> The RequiresNew self deadlock.
That was it. Thanks!
Nate -
3. Re: Deadlock not detected?
the_bone_ranger Oct 12, 2003 3:43 PM (in response to natemc)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) -
4. Re: Deadlock not detected?
adrian.brock Oct 15, 2003 4:59 PM (in response to natemc)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. :-)
Regards,
Adrian