i have a problem, the application I am working on.
The database access is managed by Session EJB.
So, if the user needs some data He/She calls a method of a Session EJB which calls some DAO and returns to the user a Collection of data.
The application worked well until some users started to use it a alot.
So, the situatio is :
- An user A calls a method of the Session EJB which calls some DAO to
perform some SELECT queries on the table TEST
- While the user A is doing its job an user B calls a method of the same
Session EJB to perform an INSERT query on the table TEST
The result is that the table TEST has a DEADLOCK, because it seems that the method which performs the SELECT queries LOCKS the table TEST.
We have this kind of behavoiur because every method of the Session EJB is marked as Transaction REQUIRED.
So, what is the right transaction attribute to specify on the methods of the Session EJB for not to generate the DEADLOCK problem ?
Any suggestion ?