blocked transaction
smirakr Sep 5, 2001 4:14 AMHi all,
I am working with JBoss 2.2.2 (same behaviour on JBoss2.4), JDK1.3, OS Linux and I have this problem:
business method of EntityBean set "rollback" flag and throws application exception. Example:
public void businessMethod() throws RemoteException, ApplicationException {
if(!condition) {
this.entityContext.setRollbackOnly();
throw new ApplicationException("no valid data");
}
// next business code
}
From EJB specification I am understand that:
"An application exception is an exception defined in the throws clause of a method of the enterprise Bean s home and remote interfaces, other than the java.rmi.RemoteException." Example:
public class ApplicationException extends Exception {
//...
}
Next, I have this situation: in deployment descriptor I set transaction attribute of the business method to "required".
Next, from EJB specification I am understand that:
>> Container start: "Bean method runs in the context of a transaction that the Container started immediately before dispatching the business method. This case may happen with Required and RequiresNew attributes".
>> EntityBean throws: AppException
>> Container behaviour: "If the instance called set-RollbackOnly(), then rollback the transaction, and re-throw AppException. Otherwise, attempt to commit the transaction, and then re-throw AppException".
>> Client view: "receives AppException. If the client executes in a transaction, the clients transaction is not marked for rollback, and client can continue its work. all other exceptions Log the exception or error. Receives RemoteException".
In my case: container was started transaction, setRollbackOnly was called, AppException was throwed.
Real behaviour: container do not commint the transaction and re-trows AppException (this is OK) but next call on the same EntityBean is blocked while timeout of new transaction occures.
My question:
>> why is new call blocked? (finishing (ie. rollback) of the previous transaction is responsibility of the container or not? - and more: if new transaction is not finished why it does not timeout?)
Thanks.
Roman SMIRAK.