Why “TransactionReaper::check timeout for TX” warn

2019-06-15 07:37发布

问题:


I am using Hibernate 3.6.0 with JBoss 6.0-Final release and my Database is MS-SQL Server 2008. I have to fetch employee data from LDAP server and insert those into database - the count of LDAP entries are 180,000 or more. I am using bean managed transaction because using CMT my transaction never gets committed (because of high volumn of insert).

The logic is: in a while-loop I am keep on fetching & creating entries in database using JPA (Hibernate). Thus I am having a long series of fetch-create activities as part of a stateless EJB api. I am invoking entityManager.flush()/clear() and commiting transaction after processing every 20 records.

I am getting following WARN message in JBoss Serevr.log after I have inserted 40,000 records. Not sure if it is really an warning or error?
Though I get this error, the server still runs and continues with inserting new records in DB.

Can anyone suggest if I am doing something wrong? Or what causes this error?

Is there a way to increase the EJB timeout?

16:52:49,690 WARN  [com.arjuna.ats.arjuna] ARJUNA-12117 TransactionReaper::check timeout for TX 0:ffff105966b8:126a:4db9fc0a:a4 in state  RUN
16:52:49,691 WARN  [com.arjuna.ats.arjuna] ARJUNA-12121 TransactionReaper::doCancellations worker Thread[Transaction Reaper Worker 0,5,jboss] successfully canceled TX 0:ffff105966b8:126a:4db9fc0a:a4

Any help will be much appreciated.

回答1:

This website summarizes a couple of more ways for changing the transaction timeout of jboss. For example, you can specify it in your standalone.xml configuration file as a subsystem like this:

<subsystem xmlns="urn:jboss:domain:transactions:3.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 default-timeout="<your timeout value here>"/>
</subsystem>

Alternative adjust the transaction timeout prameter via the jboss admin platform under subsystems->transaction->Time Out

Maybe that will help.



回答2:

As per your own comment (but to give an actual example), if you need to increase a transaction time-out you can use an annotation on the method of whichever class defines your transactional boundary (usually a "facade" implmentation).

For example, using org.springframework.transaction.annotation.Transactional

@Transactional(timeout = 600) // value is in seconds

It sounds like you need this for a one-off data conversion task rather than day-to-day production code so increasing the time-out is probably justifiable. Otherwise it would be worth considering batching the processing into smaller chunks and making each one a unique transaction which is expected to complete within the default time-out for your system.



标签: jboss timeout