Hello Davide,

let's consider a simple case. There are two entity beans BeanA and
BeanB. And two threads/transactions T1 and T2 accessing these beans.

Accessing in the same order:
T1: -> BeanA -> BeanB
T2: -> BeanA -> BeanB

Accessing in the opposite order:
T1: -> BeanA -> BeanB
T2: -> BeanB -> BeanA

If you are using default configuration (pessimistic locking) the
second case provokes a deadlock. The following could happen: T1
accesses BeanA and locks it, at the same time T2 accesses BeanB and
locks it. Then T1 attempts to access and lock BeanB and is blocked and
T2 attempts to access and lock BeanA and is blocked.
Both wait for each other to release the lock causing a deadlock.
This won't happen in the first case.

alex

Tuesday, July 29, 2003, 3:22:50 PM, Davide Pozza wrote:

DP> Hi Alexey,
DP> On the previous post you say:
>> Some threads are accessing the same set of beans in different order.

DP> Many times reading other posts or the JBoss documentation, I've found this phrase, 
but I can't understand it very well...
DP> What's the meaning of the "entity beans ordered access" (see "JBoss Administration 
and Development 2nd ed." pag 208) ?

DP> Thanks in advance

DP> Davide



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to