Delete redundant persistenceAdapter.getTransactionContext

This commit is contained in:
Dominik Przybysz 2016-02-29 13:21:58 +01:00 committed by Hadrian Zbarcea
parent d54d046b8a
commit 0d90a2a683
1 changed files with 5 additions and 7 deletions

View File

@ -16,11 +16,6 @@
*/ */
package org.apache.activemq.store.jdbc; package org.apache.activemq.store.jdbc;
import java.io.IOException;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.LinkedList;
import org.apache.activemq.ActiveMQMessageAudit; import org.apache.activemq.ActiveMQMessageAudit;
import org.apache.activemq.broker.ConnectionContext; import org.apache.activemq.broker.ConnectionContext;
import org.apache.activemq.command.ActiveMQDestination; import org.apache.activemq.command.ActiveMQDestination;
@ -38,6 +33,11 @@ import org.apache.activemq.wireformat.WireFormat;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.LinkedList;
/** /**
* *
*/ */
@ -86,7 +86,6 @@ public class JDBCMessageStore extends AbstractMessageStore {
private void recordDestinationCreation(ActiveMQDestination destination) throws IOException { private void recordDestinationCreation(ActiveMQDestination destination) throws IOException {
TransactionContext c = persistenceAdapter.getTransactionContext(); TransactionContext c = persistenceAdapter.getTransactionContext();
try { try {
c = persistenceAdapter.getTransactionContext();
if (adapter.doGetLastAckedDurableSubscriberMessageId(c, destination, destination.getQualifiedName(), destination.getQualifiedName()) < 0) { if (adapter.doGetLastAckedDurableSubscriberMessageId(c, destination, destination.getQualifiedName(), destination.getQualifiedName()) < 0) {
adapter.doRecordDestination(c, destination); adapter.doRecordDestination(c, destination);
} }
@ -273,7 +272,6 @@ public class JDBCMessageStore extends AbstractMessageStore {
// Get all the Message ids out of the database. // Get all the Message ids out of the database.
TransactionContext c = persistenceAdapter.getTransactionContext(); TransactionContext c = persistenceAdapter.getTransactionContext();
try { try {
c = persistenceAdapter.getTransactionContext();
adapter.doRecover(c, destination, new JDBCMessageRecoveryListener() { adapter.doRecover(c, destination, new JDBCMessageRecoveryListener() {
@Override @Override
public boolean recoverMessage(long sequenceId, byte[] data) throws Exception { public boolean recoverMessage(long sequenceId, byte[] data) throws Exception {