I have an EJB 3.0 based application deployed on JBoss 5.1. The global transaction timeout value configured in $ {JBOSS_HOME} / server / default / deploy / transaction-jboss- beans.xml on property transactionTimeout is great for most of our EJB methods. However, we have some methods whose duration is expected to be much longer than the value set there. We would like to override the timeout specifically for these methods.
We tried to do this as described here , that is, let's assume a global value with a reasonable value, and then try to override certain methods through the deployment descriptor in jboss.xml or through specific jboss annotations inside the method.
Methods are inside a beans-free management session. I even made these methods create a new transaction, as in some places it says that the annotation only works if the transaction is created at that moment.
../..
import org.jboss.ejb3.annotation.TransactionTimeout;
../..
@Override
@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
@TransactionTimeout(900)
public FileInfoObject setFileVariable(Desk desk, String variable, int maxBytes,
String mimeAccepted, FileWithStream file)
throws ParticipationFinishedException, PersistenceException {
../..
}
The expected behavior is that for this method the wait time should be 900.
The actual behavior is pretty good and the following:
- If global timeout> method timeout, then timeout method is applied
- if global timeout <= method timeout, then global timeout applies
, - - , , , .
? - ?