Uploaded image for project: 'ActiveMQ C++ Client'
  1. ActiveMQ C++ Client
  2. AMQCPP-648

Invalid cast in ConnectionState object in ConnectionStateTracker called from FailoverTransport::oneway() while initiating an XA transaction

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.9.5
    • None
    • Transports
    • None

    Description

      From a C application we use the ActiveMQ-CPP libraries (version 3.9.5) to interact with ActiveMQ Classic 5.15.11.

      Our application connects to a broker using the failover transport.

      When starting an XA transaction, we first create an XID (an object of type XATransactionId) and use it to start the XA transaction with the XAResource::start method. Control then flows through several layers to arrive in the FailoverTransport::oneway method where a state tracker is called. The state tracker leads to a ConnectionStateTracker::processBeginTransaction method that grabs our XID (an XATransactionId) and tries to cast it to a LocalTransactionId. Both XATransactionId and LocalTransactionId inherit from TransactionId, but an XATransactionId is obviously not a LocalTransactionId and the cast fails. Our attempt to start an XA transaction therefore also fails.

      Using tcp transport instead of failover allows our code to correctly start the XA transaction but is not a viable solution for production use.

      Is what we observed (impossible to start an XA transaction while using failover) the expected behaviour (and if so, what is the rationale for it) or is it a bug in the library?

      Attachments

        Activity

          People

            tabish Timothy A. Bish
            sbn Sven Bovin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: