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 voidacknowledge(TopicMessageStore topicMessageStore, String clientId, String subscriptionName, MessageId messageId, MessageAck ack)protected voidonRecovered(MemoryTransactionStore.Tx tx)voidprepare(TransactionId txid)voidrecover(TransactionRecoveryListener listener)voidrecoverAck(long id, byte[] xid, byte[] message)voidrecoverAdd(long id, byte[] messageBytes)voidrecoverLastAck(byte[] encodedXid, ActiveMQDestination destination, String subName, String clientId)voidrollback(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:
preparein interfaceTransactionStore- Overrides:
preparein classMemoryTransactionStore- Throws:
IOException- See Also:
TransactionStore.prepare(TransactionId)
-
rollback
public void rollback(TransactionId txid) throws IOException
- Specified by:
rollbackin interfaceTransactionStore- Overrides:
rollbackin classMemoryTransactionStore- Throws:
IOException- See Also:
TransactionStore.rollback(TransactionId)
-
recover
public void recover(TransactionRecoveryListener listener) throws IOException
- Specified by:
recoverin interfaceTransactionStore- Overrides:
recoverin 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:
onRecoveredin classMemoryTransactionStore
-
acknowledge
public void acknowledge(TopicMessageStore topicMessageStore, String clientId, String subscriptionName, MessageId messageId, MessageAck ack) throws IOException
- Overrides:
acknowledgein classMemoryTransactionStore- Throws:
IOException
-
-