I'm currently trying to upgrade my web application from jboss 5.1 to jboss 7.1.1.Final
In my jboss.xml I have configured some custom ejb timeouts like the following:
<session>
<ejb-name>MSServiceEJB</ejb-name>
<jndi-name>ejb/MSServiceEJB</jndi-name>
<local-jndi-name>ejb/LocalMSServiceEJB</local-jndi-name>
<method-attributes>
<method>
<method-name>*</method-name>
<transaction-timeout>3600</transaction-timeout>
</method>
</method-attributes>
</session>
jboss 7 ignores jboss.xml, where can I specify my ejb 2.1 transaction timeouts?
Per
Source
Replace the jboss.xml deployment descriptor file
The jboss-ejb3.xml deployment descriptor replaces the jboss.xml deployment descriptor to override and add to the features provided by the Java Enterprise Edition (EE) defined ejb3-jar.xml deployment descriptor. The new file is incompatible with jboss.xml, and the jboss.xml is now ignored in deployments.
You need to create a jboss-ejb3.xml
and put the configuration inside it.
It would look something like this:
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>EJBName</ejb-name>
<method-name>methodName</method-name>
<method-intf>Local</method-intf>
</method>
<tx:trans-timeout>
<tx:timeout>500</tx:timeout>
<tx:unit>Seconds</tx:unit>
</tx:trans-timeout>
</container-transaction>
</assembly-descriptor>
You are using EJB2.x
, so it would be better and wise to configure it in ejb-jar.xml
It should be created in META-INF of the EJB jar
.
You can specify on the Bean method with @TransactionTimeOut annotation.
@TransactionTimeout(value = 10, unit = TimeUnit.SECONDS)
For detailed description of how to set, please refer here
Maddy
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With