Vinay,
 
I'm pretty sure the EJB spec says that an instance of an EntityBean can only process one request at a time.  I think this is what the Context lock is for.
 
When you say that your bean is readonly, you mean that you defined it in JAWS as readonly?  I'm pretty sure the code does NOT check to see if the EntityBean is JAWS and therefore doesn't check to see if it is readonly.
 
IMHO, there should be an option to remove EntityBean locking and let the Database handle the synchronization either through the select-for-update option, or doing the locks in BMP.
 
Bill
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of K.V. Vinay Menon
Sent: Monday, June 04, 2001 6:17 PM
To: [EMAIL PROTECTED]
Subject: Re: [JBoss-dev] Caching - Locking - Server Dies!

Bill,
    I have tried both options. Started without a container transaction defined. In which case it kept throwing LOCKING-WAITING transactions [ from the EntityInstanceInterceptor] which says that JBoss is creating a transaction automatically. Next I changed the ejb-jar to specify the container transaction as REQUIRESNEW and as expected it did create a new transaction and hence showed the same messages. Finally, changed the container transaction to SUPPORTS when it stopped locking for the TRANSACTION and started locking waiting for the CTX [Context] in the else clause of the EntityInstanceInterceptor's invoke method. So there you go. Why is it locking for  readonly bean? Why does it need to do it? The effects are only marginal and hardly detectable at low loads. It is more pronounced at higher loads and as the table size increase it goes into a real amplifying loop where the beans wait and take longer to return and that in turn cause the lock to be longer and so on.
 
Strange that the method does not check for read-only attribute either? Why is that?
 
Vinay
----- Original Message -----
From: Bill Burke
Sent: Monday, June 04, 2001 9:10 PM
Subject: RE: [JBoss-dev] Caching - Locking - Server Dies!

If an Entity is loaded within a transaction it is locked until the transaction completes.
 
Bill
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of K.V. Vinay Menon
Sent: Monday, June 04, 2001 12:59 PM
To: User @ JBoss; Dev @ JBoss
Subject: [JBoss-dev] Caching - Locking - Server Dies!

Hello Folks,
    Continuing with my load test I find something strange. I have a test harness that simulates 100 clients hitting the server at 100ms. They all retrieve the same data  - 150 odd records  - from the database. The cache size has been set to 100000. Commit option is A. Am not doing any write operations.
 
1. The retrieve for the first client is high as expected.
2. This then falls rapidly to about 90ms.
3. However the response time then rises to aout 20 seconds.
 
On checking the server log, I am getting loads of 'LOCKING-WAITING (TRANSACTION)' messages.  And its due to this locking I presume that the response time takes a beating.
 
 
a) Why is it not just reading data from cache?
b) Why is it locking for read only opertions?
 
Why is this so? All this seems very strange. Either I am missing something or the caching is not working for high loads.
 
Regards,
 
Vinay

Reply via email to