Package org.apache.activemq.store.jdbc
Class JdbcMemoryTransactionStore
- java.lang.Object
-
- org.apache.activemq.store.memory.MemoryTransactionStore
-
- org.apache.activemq.store.jdbc.JdbcMemoryTransactionStore
-
- All Implemented Interfaces:
Service
,TransactionStore
public class JdbcMemoryTransactionStore extends MemoryTransactionStore
respect 2pc prepare uses local transactions to maintain prepared state xid column provides transaction flag for additions and removals a commit clears that context and completes the work a rollback clears the flag and removes the additions Essentially a prepare is an insert &| update transaction commit|rollback is an update &| remove
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.activemq.store.memory.MemoryTransactionStore
MemoryTransactionStore.AddMessageCommand, MemoryTransactionStore.RemoveMessageCommand, MemoryTransactionStore.Tx
-
-
Field Summary
-
Fields inherited from class org.apache.activemq.store.memory.MemoryTransactionStore
inflightTransactions, persistenceAdapter, preparedTransactions
-
-
Constructor Summary
Constructors Constructor Description JdbcMemoryTransactionStore(JDBCPersistenceAdapter jdbcPersistenceAdapter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
acknowledge(TopicMessageStore topicMessageStore, String clientId, String subscriptionName, MessageId messageId, MessageAck ack)
protected void
onRecovered(MemoryTransactionStore.Tx tx)
void
prepare(TransactionId txid)
void
recover(TransactionRecoveryListener listener)
void
recoverAck(long id, byte[] xid, byte[] message)
void
recoverAdd(long id, byte[] messageBytes)
void
recoverLastAck(byte[] encodedXid, ActiveMQDestination destination, String subName, String clientId)
void
rollback(TransactionId txid)
-
Methods inherited from class org.apache.activemq.store.memory.MemoryTransactionStore
commit, delete, getPreparedTx, getTx, onProxyQueueStore, onProxyTopicStore, proxy, proxy, start, stop
-
-
-
-
Constructor Detail
-
JdbcMemoryTransactionStore
public JdbcMemoryTransactionStore(JDBCPersistenceAdapter jdbcPersistenceAdapter)
-
-
Method Detail
-
prepare
public void prepare(TransactionId txid) throws IOException
- Specified by:
prepare
in interfaceTransactionStore
- Overrides:
prepare
in classMemoryTransactionStore
- Throws:
IOException
- See Also:
TransactionStore.prepare(TransactionId)
-
rollback
public void rollback(TransactionId txid) throws IOException
- Specified by:
rollback
in interfaceTransactionStore
- Overrides:
rollback
in classMemoryTransactionStore
- Throws:
IOException
- See Also:
TransactionStore.rollback(TransactionId)
-
recover
public void recover(TransactionRecoveryListener listener) throws IOException
- Specified by:
recover
in interfaceTransactionStore
- Overrides:
recover
in classMemoryTransactionStore
- Throws:
IOException
-
recoverAdd
public void recoverAdd(long id, byte[] messageBytes) throws IOException
- Throws:
IOException
-
recoverAck
public void recoverAck(long id, byte[] xid, byte[] message) throws IOException
- Throws:
IOException
-
recoverLastAck
public void recoverLastAck(byte[] encodedXid, ActiveMQDestination destination, String subName, String clientId) throws IOException
- Throws:
IOException
-
onRecovered
protected void onRecovered(MemoryTransactionStore.Tx tx)
- Overrides:
onRecovered
in classMemoryTransactionStore
-
acknowledge
public void acknowledge(TopicMessageStore topicMessageStore, String clientId, String subscriptionName, MessageId messageId, MessageAck ack) throws IOException
- Overrides:
acknowledge
in classMemoryTransactionStore
- Throws:
IOException
-
-