@Override public void doAddMessage(TransactionContext c, long sequence, MessageId messageID, ActiveMQDestination destination, byte[] data, long expiration, byte priority, XATransactionId xid) throws SQLException, IOException { PreparedStatement s = null; try { // Add the Blob record. s = c.getConnection().prepareStatement(statements.getAddMessageStatement()); s.setLong(1, sequence); s.setString(2, messageID.getProducerId().toString()); s.setLong(3, messageID.getProducerSequenceId()); s.setString(4, destination.getQualifiedName()); s.setLong(5, expiration); s.setLong(6, priority); if (s.executeUpdate() != 1) { throw new IOException("Failed to add broker message: " + messageID + " in container."); } s.close(); // Select the blob record so that we can update it. updateBlob(c.getConnection(), statements.getFindMessageByIdStatement(), sequence, data); if (xid != null) { byte[] xidVal = xid.getEncodedXidBytes(); xidVal[0] = '+'; updateBlob(c.getConnection(), statements.getFindXidByIdStatement(), sequence, xidVal); } } finally { close(s); } }
@Override public void doAddMessage(TransactionContext c, long sequence, MessageId messageID, ActiveMQDestination destination, byte[] data, long expiration, byte priority, XATransactionId xid) throws SQLException, IOException { PreparedStatement s = null; try { // Add the Blob record. s = c.getConnection().prepareStatement(statements.getAddMessageStatement()); s.setLong(1, sequence); s.setString(2, messageID.getProducerId().toString()); s.setLong(3, messageID.getProducerSequenceId()); s.setString(4, destination.getQualifiedName()); s.setLong(5, expiration); s.setLong(6, priority); if (s.executeUpdate() != 1) { throw new IOException("Failed to add broker message: " + messageID + " in container."); } s.close(); // Select the blob record so that we can update it. updateBlob(c.getConnection(), statements.getFindMessageByIdStatement(), sequence, data); if (xid != null) { byte[] xidVal = xid.getEncodedXidBytes(); xidVal[0] = '+'; updateBlob(c.getConnection(), statements.getFindXidByIdStatement(), sequence, xidVal); } } finally { close(s); } }
@Override public void doAddMessage(TransactionContext c, long sequence, MessageId messageID, ActiveMQDestination destination, byte[] data, long expiration, byte priority, XATransactionId xid) throws SQLException, IOException { PreparedStatement s = null; try { // Add the Blob record. s = c.getConnection().prepareStatement(statements.getAddMessageStatement()); s.setLong(1, sequence); s.setString(2, messageID.getProducerId().toString()); s.setLong(3, messageID.getProducerSequenceId()); s.setString(4, destination.getQualifiedName()); s.setLong(5, expiration); s.setLong(6, priority); if (s.executeUpdate() != 1) { throw new IOException("Failed to add broker message: " + messageID + " in container."); } s.close(); // Select the blob record so that we can update it. updateBlob(c.getConnection(), statements.getFindMessageByIdStatement(), sequence, data); if (xid != null) { byte[] xidVal = xid.getEncodedXidBytes(); xidVal[0] = '+'; updateBlob(c.getConnection(), statements.getFindXidByIdStatement(), sequence, xidVal); } } finally { close(s); } }
@Override public void doAddMessage(TransactionContext c, long sequence, MessageId messageID, ActiveMQDestination destination, byte[] data, long expiration, byte priority, XATransactionId xid) throws SQLException, IOException { PreparedStatement s = null; try { // Add the Blob record. s = c.getConnection().prepareStatement(statements.getAddMessageStatement()); s.setLong(1, sequence); s.setString(2, messageID.getProducerId().toString()); s.setLong(3, messageID.getProducerSequenceId()); s.setString(4, destination.getQualifiedName()); s.setLong(5, expiration); s.setLong(6, priority); if (s.executeUpdate() != 1) { throw new IOException("Failed to add broker message: " + messageID + " in container."); } s.close(); // Select the blob record so that we can update it. updateBlob(c.getConnection(), statements.getFindMessageByIdStatement(), sequence, data); if (xid != null) { byte[] xidVal = xid.getEncodedXidBytes(); xidVal[0] = '+'; updateBlob(c.getConnection(), statements.getFindXidByIdStatement(), sequence, xidVal); } } finally { close(s); } }