Hi!
I have two entity beans for example: A, B
There is a relation between these beans, and I have to be able to access B from A and A
from B.
A: getTitle() {
return name + getB().getName();
}
B: getTitle() {
return name + getA().getName();
}
When a thread calls A.getTitle() and an other thread calls B.getTitle(), there can be a
deadlock: thread1 locks A; thread2 locks B; thread1 waits for B; thread2 waits for A ->
deadlock
What can I do to avoid these deadlock? Read-only method declaration isn't enough. I
have to call the beans from each other. The real situation is much more difficult, it is
only a simplified case.
How can I obtain that a get method doesn't lock the bean itself?
Thanks, Tamas
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4257064#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...