mirror of https://github.com/apache/activemq.git
Fixing regression introduced by AMQ-4529 the JdbcXARecoveryBrokerTest was failing.
Switching the jdbc store to use the entryLocator instead of the dataLocator git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1482334 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
63c0ef179a
commit
1399cf9522
|
@ -129,7 +129,7 @@ public class JDBCMessageStore extends AbstractMessageStore {
|
|||
c.close();
|
||||
}
|
||||
if (context != null && context.getXid() != null) {
|
||||
message.getMessageId().setDataLocator(sequenceId);
|
||||
message.getMessageId().setEntryLocator(sequenceId);
|
||||
} else {
|
||||
onAdd(messageId, sequenceId, message.getPriority());
|
||||
}
|
||||
|
@ -204,7 +204,7 @@ public class JDBCMessageStore extends AbstractMessageStore {
|
|||
c.close();
|
||||
}
|
||||
if (context != null && context.getXid() != null) {
|
||||
ack.getLastMessageId().setDataLocator(seq);
|
||||
ack.getLastMessageId().setEntryLocator(seq);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -737,7 +737,7 @@ public class JDBCPersistenceAdapter extends DataSourceServiceSupport implements
|
|||
public void commitAdd(ConnectionContext context, MessageId messageId) throws IOException {
|
||||
TransactionContext c = getTransactionContext(context);
|
||||
try {
|
||||
long sequence = (Long)messageId.getDataLocator();
|
||||
long sequence = (Long)messageId.getEntryLocator();
|
||||
getAdapter().doCommitAddOp(c, sequence);
|
||||
} catch (SQLException e) {
|
||||
JDBCPersistenceAdapter.log("JDBC Failure: ", e);
|
||||
|
@ -750,7 +750,7 @@ public class JDBCPersistenceAdapter extends DataSourceServiceSupport implements
|
|||
public void commitRemove(ConnectionContext context, MessageAck ack) throws IOException {
|
||||
TransactionContext c = getTransactionContext(context);
|
||||
try {
|
||||
getAdapter().doRemoveMessage(c, (Long)ack.getLastMessageId().getDataLocator(), null);
|
||||
getAdapter().doRemoveMessage(c, (Long)ack.getLastMessageId().getEntryLocator(), null);
|
||||
} catch (SQLException e) {
|
||||
JDBCPersistenceAdapter.log("JDBC Failure: ", e);
|
||||
throw IOExceptionSupport.create("Failed to commit last ack: " + ack + ". Reason: " + e,e);
|
||||
|
|
|
@ -106,7 +106,7 @@ public class JdbcMemoryTransactionStore extends MemoryTransactionStore {
|
|||
jdbcPersistenceAdapter.commitAdd(context, message.getMessageId());
|
||||
((JDBCMessageStore)addMessageCommand.getMessageStore()).onAdd(
|
||||
message.getMessageId(),
|
||||
(Long)message.getMessageId().getDataLocator(),
|
||||
(Long)message.getMessageId().getEntryLocator(),
|
||||
message.getPriority());
|
||||
|
||||
}
|
||||
|
@ -163,7 +163,7 @@ public class JdbcMemoryTransactionStore extends MemoryTransactionStore {
|
|||
|
||||
public void recoverAdd(long id, byte[] messageBytes) throws IOException {
|
||||
final Message message = (Message) ((JDBCPersistenceAdapter)persistenceAdapter).getWireFormat().unmarshal(new ByteSequence(messageBytes));
|
||||
message.getMessageId().setDataLocator(id);
|
||||
message.getMessageId().setEntryLocator(id);
|
||||
Tx tx = getPreparedTx(message.getTransactionId());
|
||||
tx.add(new AddMessageCommand() {
|
||||
@Override
|
||||
|
@ -186,7 +186,7 @@ public class JdbcMemoryTransactionStore extends MemoryTransactionStore {
|
|||
|
||||
public void recoverAck(long id, byte[] xid, byte[] message) throws IOException {
|
||||
Message msg = (Message) ((JDBCPersistenceAdapter)persistenceAdapter).getWireFormat().unmarshal(new ByteSequence(message));
|
||||
msg.getMessageId().setDataLocator(id);
|
||||
msg.getMessageId().setEntryLocator(id);
|
||||
Tx tx = getPreparedTx(new XATransactionId(xid));
|
||||
final MessageAck ack = new MessageAck(msg, MessageAck.STANDARD_ACK_TYPE, 1);
|
||||
tx.add(new RemoveMessageCommand() {
|
||||
|
|
Loading…
Reference in New Issue