JBoss transaction timeout setting?

2019-02-03 17:31发布

We have a timer service triggered task in JBoss 5.1.0.GA application and the problem is that we cannot change the transaction time out. This long Lucene indexing can take longer than the default 300 second limit.

The question is how to change the timeout value, adding @TransactionTimeout(1800) to the worker method or the class did not have any effect.

Edit: Setting this in deploy/transaction-jboss-beans.xml works fine:

<property name="transactionTimeout">1800</property>

but the annotation doesn't seem to have effect on either timer initiated or normal stateless EJBs.

7条回答
兄弟一词,经得起流年.
2楼-- · 2019-02-03 18:12

I am using EJB3 with Jboss 5.1.0.GA and have successfully set this value in JBOSS_HOME/deploy/transaction-jboss-beans.xml.

The default was 300 in <property name="transactionTimeout">300</property>

查看更多
时光不老,我们不散
3楼-- · 2019-02-03 18:15

You can manually declare the timeout period and create a timer in Session Bean.

Below is sample code of my Stateless Bean :

public void createTimer(String timerName) {
  //...
  sessionContext.getTimerService().createTimer(timeLongValue, timerName);
  //...
}

@Timeout
public void timeOutHandler(Timer timer){
  // code  
}
查看更多
倾城 Initia
4楼-- · 2019-02-03 18:18

TransactionTimeout is it a MDB? they have a different annotation. The link gives the various options for setting the transation timeout either via code on config files.

查看更多
We Are One
5楼-- · 2019-02-03 18:29

Transaction timeout,default settings in JBOSS EPA 7.1 version is 300.

jboss portal screen

Add this line(<coordinator-environment enable-tsm-status="true" default-timeout="1200"/>) add the configuration file in path "..standalone/configuration/standalone.xml"

                                    ....
<subsystem xmlns="urn:jboss:domain:transactions:4.0">
            <core-environment>
                <process-id>
                    <uuid/>
                </process-id>
            </core-environment>
            <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>
            <coordinator-environment enable-tsm-status="true" default-timeout="1200"/>
            <object-store path="tx-object-store" relative-to="jboss.server.data.dir"/>
 </subsystem>
查看更多
狗以群分
6楼-- · 2019-02-03 18:32

Not related to Jboss but you can set arjuna transaction timeout via com.arjuna.ats.arjuna.coordinator.defaultTimeout=60 property.

查看更多
闹够了就滚
7楼-- · 2019-02-03 18:33

Try setting this in jboss-service.xml:

   <!-- JBoss Transactions JTA -->
   <mbean code="com.arjuna.ats.jbossatx.jta.TransactionManagerService"
      name="jboss:service=TransactionManager">
      <attribute name="TransactionTimeout">120</attribute> <!-- timeout in seconds-->
      <attribute name="ObjectStoreDir">${jboss.server.data.dir}/tx-object-store</attribute>
   </mbean>

This is a server based configuration, so look for conf/jboss-service.xml under your server directory.

查看更多
登录 后发表回答