1 2 Previous Next 17 Replies Latest reply on Oct 20, 2009 9:32 AM by ovi Go to original post
      • 15. Re: Weird transaction error
        theoverlord

         

        "jhalliday" wrote:
        https://jira.jboss.org/jira/browse/JBAS-5801


        Good find !!!!

        I try adding <track-connection-by-tx/> to my JMS datasource file.

        I'll report back on my results.


        • 16. Re: Weird transaction error
          theoverlord

          I can confirm that adding <track-connection-by-tx/> to my JMS datasource file fixed the problem.

          It should look like this:

          <tx-connection-factory>
           <jndi-name>JmsXA</jndi-name>
           <xa-transaction/>
           <rar-name>jms-ra.rar</rar-name>
          
           <!-- ADD THIS. DONT FORGET IT !!!!!!!!!!!!! -->
           <track-connection-by-tx/>
           <connection-definition>org.jboss.resource.adapter.jms.JmsConnectionFactory</connection-definition>
           <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
           <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
           <max-pool-size>20</max-pool-size>
           <security-domain-and-application>JmsXARealm</security-domain-and-application>
           </tx-connection-factory>
          


          Arghhhhh, I can't believe that this was the cause of all my pain.

          How was I supooed to know that some obscure setting was causing all this commit/rollback and IllegalMonitorState exceptions !!

          It should be there by default.

          OMFG, I lost so much sleep over this.


          • 17. Re: Weird transaction error
            ovi

            I had the same problem which on my side was caused by accessing 2 different data-sources within the same transaction (XA transaction on Oracle database).

            E.g. Method X is calling method Y which does an database A insert and calls method Z which does a database B update.

            The solution was to annotate method Y and method Z with: @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)

            Hope this helps.

            1 2 Previous Next