Hi Jonas team,

 

Can you please explain behavior of Jonas 2.3 in a following situation?

 

There are two entity beans with container managed persistence in the database

Bean A in table A.

Bean B in table B

 

We are encountering deadlock with a following sequence of operations:

 

Client 1 creates transaction (session bean attribute requires) and goes and reads bean A

Client 2 doesn't need transaction (session bean attribute supports) so it doesn't create one and read bean B
Client 1 (in transaction) goes and tries to read bean B. I can see from the output from ContextSwitch that it just goes to wait()

Client 2 tries to read bean A and waits too

 

Everything hangs

Then transaction timeout

Client 1 receives exception and rollbacks

Client 2 normally continues.

 

What I don't understand is why Jonas makes client 2 wait to read bean A when it is not in the transaction? If it cannot read the shared copy, why it didn't get unshared read only copy of the record/bean?

Also why Jonas makes client 1 wait for bean B when this bean was read outside of transaction and is not going to be modified?

 

Is it transaction setting?

 

This happens with both Interbase and SQLServer.

 

Interbase has setting datasource.isolationlevel   read_committed

SQLServer has not corresponding setting in a property file.

 

Thanks a lot for any ideas,

 

Miro Halas

Reply via email to