Uploaded image for project: 'ServiceMix'
  1. ServiceMix
  2. SM-981

Transaction Exception due to ServiceMix JMS Provider

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.1
    • 3.2
    • servicemix-jms
    • None
    • All platforms. The bug was encountered on ServiceMix 3.1 running in JBoss against JBossMQ.

    • Patch Available

    Description

      Hi all,

      under heavy load, we have encountered a problem when writing messages using the JMS provider in a synchronous, transactional flow.

      The problem is that in the code (lines 100 and up)

      producer.send(msg);
      exchange.setStatus(ExchangeStatus.DONE);
      channel.send(exchange);
      } finally {
      if (session != null)

      { session.close(); }
      if (connection != null) { connection.close(); }
      }

      it is possible that the DONE state would return to the originator faster than the session and the connection is closed in the finally section. If this happens, the originator (and therefore owner of the transaction) will first commit and after this the provider would close the connection.

      This results in a transaction exception.

      From what we can tell, it should read like this:

      producer.send(msg);
      } finally {
      if (session != null) { session.close(); }

      if (connection != null)

      { connection.close(); }

      }

      exchange.setStatus(ExchangeStatus.DONE);
      channel.send(exchange);

      due to which we guarantee that the connection is safely closed before we send the confirmation back to the consumer.

      All of our load tests succeeded after this change.

      Best regards

      Martin Landua

      Attachments

        Activity

          People

            gnodet Guillaume Nodet
            mlandua Martin Landua
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: