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

    need bigger XA resource timeout for JMS recovery

    Alexey Semenov Newbie

      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