2 Replies Latest reply on Oct 22, 2008 11:46 AM by semuse

    need bigger XA resource timeout for JMS recovery

    semuse

      Hi All,

      I've already asked this question with others in the forum about JBoss MQ, however it seems this forum is also a very appropriate place for it: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=141503

      I use JBoss 4.0.5 and MaxDB to store JMS queues, MaxDB is connected as xa-datasource, here's the definition.

      <xa-datasource>
       <jndi-name>JmsXADS</jndi-name>
       <track-connection-by-tx>true</track-connection-by-tx>
       <xa-datasource-class>com.sap.dbtech.jdbcext.XADataSourceSapDB</xa-datasource-class>
       <xa-datasource-property name="ServerName">localhost</xa-datasource-property>
       <xa-datasource-property name="DatabaseName">LOCDB</xa-datasource-property>
       <xa-datasource-property name="User">JMS</xa-datasource-property>
       <xa-datasource-property name="Password">JMS</xa-datasource-property>
       <type-mapping>SapDB</type-mapping>
       <xa-resource-timeout>300</xa-resource-timeout>
       </xa-datasource>
      


      When starting, JBoss attempts to load all messages from JMS_MESSAGES into memory, which takes longer than the transaction timeout. So, the transaction rolls back and the queue fails to initialize.

      This is the problem. I have specified a bigger value for the RecoveryTimeout attribute in the PersistenceManager definition, and it really works, when (just in order to test) I connect MaxDB as non-XA DS.

      <mbean code="org.jboss.mq.pm.jdbc2.PersistenceManager"
       name="jboss.mq:service=PersistenceManager">
       <depends optional-attribute-name="ConnectionManager">jboss.jca:service=DataSourceBinding,name=JmsXADS</depends>
       <attribute name="RecoveryTimeout">600</attribute>
       <attribute name="RecoveryRetries">2</attribute> <!-- just for test -->
      
       <attribute name="SqlProperties">
       BLOB_TYPE=BYTES_BLOB
       INSERT_TX = INSERT INTO JMS_TRANSACTIONS (TXID) values(?)
       INSERT_MESSAGE = INSERT INTO JMS_MESSAGES (MESSAGEID, DESTINATION, MESSAGEBLOB, TXID, TXOP) VALUES(?,?,?,?,?)
       ............
       CREATE_TABLES_ON_STARTUP = TRUE
       </attribute>
       </mbean>
      


      However it looks like that attribute just does not work for the XA datasource! This is just like TransactionTimeout, specified in the TransactionManagerService definition does not affect the xa resource's timeout, which is documented, but currently ignored, in JBAS-2565 (https://jira.jboss.org/jira/browse/JBAS-2565)

      So, is my guess correct? How do I then specify the bigger timeout value just for the JMS recovery?

      Thanks in advance,
      Alexey


        • 1. Re: need bigger XA resource timeout for JMS recovery
          jhalliday

          The AS 4.0 line is obsolete and you'll likely also of old age before anyone bothers to fix JIRAs against it. Get back in touch if you have the same problem with AS 4.2 or 5.0

          • 2. Re: need bigger XA resource timeout for JMS recovery
            semuse

             

            "jhalliday" wrote:
            The AS 4.0 line is obsolete and you'll likely also of old age before anyone bothers to fix JIRAs against it. Get back in touch if you have the same problem with AS 4.2 or 5.0

            Thanks for your reply!

            I've re-checked JBAS-2565, found by myself 2 months ago, and found a useful comment there:

            In JBoss Transactions, if a timeout is associated with a transaction when a resource is enlisted, the same timeout is set on the XAResource.

            So the solution will be either to try integrate JBoss Transactions into my JBoss 4.0.5 (is that possible at all?), or upgrade to JBoss 4.2.x.