JBoss transaction timeout setting?

We have the task of starting the timer in the JBoss 5.1.0.GA application, and the problem is that we cannot change the transaction time. This long Lucene indexing may take longer than the default 300 second limit.

The question is how to change the timeout value by adding @TransactionTimeout (1800) to the working method, or the class had no effect.

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

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

but the annotation does not seem to affect either timer initiated or normal stateless EJBs.

+7
timeout jboss transactions
source share
6 answers

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

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

+7
source share

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 in your server directory.

+2
source share

Is TransactionTimeout an MDB? they have another annotation. The link gives various options for setting the transmission timeout through the code in the configuration files.

+1
source share

You can manually declare a wait period and create a timer in a Bean session.

The following is a sample code of my statelessness Bean:

 public void createTimer(String timerName) { //... sessionContext.getTimerService().createTimer(timeLongValue, timerName); //... } @Timeout public void timeOutHandler(Timer timer){ // code } 
+1
source share

Specify the transaction timeout in the <blocking-timeout-millis> . This element indicates the maximum time in milliseconds to lock a transaction while waiting for a connection and before displaying an exception. This only blocks while waiting for permission to connect and does not throw an exception if you create a new connection that takes too long.

 <subsystem xmlns="urn:jboss:domain:datasources:4.0"> <datasources> <datasource jndi-name="java:jboss/xyz" pool-name="abc" enabled="true" use-java-context="true"> <connection-url>jdbc:sqlserver://xx.xx.xxx.xxx:1433;databaseName=xxxx</connection-url> <driver>SQLServerDriver</driver> <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation> <pool> <min-pool-size>50</min-pool-size> <max-pool-size>150</max-pool-size> <prefill>false</prefill> </pool> <security> <user-name>xxx</user-name> <password>xxx</password> </security> <timeout> <blocking-timeout-millis>36000</blocking-timeout-millis> </timeout> </datasource> <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true"> <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url> <driver>h2</driver> <security> <user-name>sa</user-name> <password>sa</password> </security> </datasource> <drivers> <driver name="SQLServerDriver" module="com.microsoft.sqlserver"> <xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerDataSource</xa-datasource-class> </driver> <driver name="h2" module="com.h2database.h2"> <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class> </driver> </drivers> </datasources> </subsystem> 
0
source share

Not applicable to Jboss, but you can set the timeout for an arjuna transaction through the property com.arjuna.ats.arjuna.coordinator.defaultTimeout = 60.

0
source share

All Articles