Uploaded image for project: 'ActiveMQ'
  1. ActiveMQ
  2. AMQ-3860

doAddMessageReference missing setting priority into prepared statement therefore using wrong index for message itself

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 5.4.2, 5.5.0, 5.6.0
    • Fix Version/s: 5.7.0
    • Component/s: Message Store
    • Labels:
      None

      Description

      Not sure in what cases ActiveMQDestination() is actually called, but
      getAddMessageStatement() returns statement with 7 params to set...

      public void doAddMessageReference(TransactionContext c, long sequence, MessageId messageID, ActiveMQDestination destination,
      long expirationTime, String messageRef) throws SQLException, IOException {
      PreparedStatement s = c.getAddMessageStatement();
      cleanupExclusiveLock.readLock().lock();
      try {
      if (s == null) {
      s = c.getConnection().prepareStatement(this.statements.getAddMessageStatement());
      if (this.batchStatments)

      { c.setAddMessageStatement(s); }

      }
      s.setLong(1, messageID.getBrokerSequenceId());
      s.setString(2, messageID.getProducerId().toString());
      s.setLong(3, messageID.getProducerSequenceId());
      s.setString(4, destination.getQualifiedName());
      s.setLong(5, expirationTime);
      s.setString(6, messageRef);
      if (this.batchStatments)

      { s.addBatch(); }

      else if (s.executeUpdate() != 1)

      { throw new SQLException("Failed add a message"); }

      } finally {
      cleanupExclusiveLock.readLock().unlock();
      if (!this.batchStatments)

      { s.close(); }

      }
      }

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              mikmela Mikhail Melamud
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: