4 Replies Latest reply on Aug 7, 2014 8:01 AM by rsoleto

    xa-datasource timeout transaction configuration


      Hi all,


      I am trying to set a different datasource timeout transaction for a different xa-datasource.


      Now I have two xa-datasources and I want to set diferents transaction timeouts. The property transactionTimeout fo TransactionManager in file transaction-jboss-beans.xml sets same timeout for both so that this no solve my problem.

      I found different properties in Hibernate and Jboss which would solve it but it was not successful. These properties was:


      Inside persistence.xml:

      - javax.persistence.query.timeout

      Inside xa datasource:

      - xa-resource-timeout

      - set-tx-query-timeout and query-timeout

      At present I am using EJB2.0 for transactions and it osn't possible migrate to EJB3.0 which has notation for transaction timeouts. Let me know if it's possible and in this case I would be gratful if someone could give me a guidelines.

      My Jboss version is Jboss-5.1.0.GA and my Oracle JDBC driver version is

      Thank you in advance.

        • 1. Re: xa-datasource timeout transaction configuration

          What is the purpose for different timeouts? If both are in the same transaction the Tx fails if you reach the smallest timeout

          1 of 1 people found this helpful
          • 2. Re: xa-datasource timeout transaction configuration

            When I set timeout in transaction-jboss-beans.xml and transaction reach the timeout fail. However I want a specific less timeout for one of both xa-datasource. In transaction-jboss-beans.xml there are a timeout for 300 seconds (5 minutes) but in xa-datasource I need less timeout like 100 seconds because it is an external database and I want to prevent malfunctions or it has too much data. I can't change timeout in transaction-jboss-beans.xml because other datasource need 300 seconds.


            Thanks for your reply.

            • 3. Re: xa-datasource timeout transaction configuration


              I have a similar scenary, I read data from different data bases and one of them belongs to a third party. The reads from this database must be fast and we would like to set a short timeout when we read from it, if it is possible to configure this instead of setting it using code (maybe with some jpa property) it would be wonderful.


              Did you find a solution for this?


              Thanks in advance

              • 4. Re: xa-datasource timeout transaction configuration

                Hi aida.sp,


                Thanks for your interest but I haven't found a solution yet. All my attemps fail