[infinispan-issues] [JBoss JIRA] (ISPN-4983) Public API for tracking completion of Infinispan work for a given user transaction
Randall Hauch (JIRA)
issues at jboss.org
Fri Nov 14 11:58:29 EST 2014
Randall Hauch created ISPN-4983:
-----------------------------------
Summary: Public API for tracking completion of Infinispan work for a given user transaction
Key: ISPN-4983
URL: https://issues.jboss.org/browse/ISPN-4983
Project: Infinispan
Issue Type: Feature Request
Reporter: Randall Hauch
When using Infinispan with user transactions, Infinispan will persist the changes to the cache store using a synchronization on the user transaction. This means the persistence operation begins when the user transaction has committed. However, components using Infinispan will likely want to know when Infinispan's work has completed for a given transaction.
In Infinispan 6, it was possible to do this by registering a transaction listener:
{code}
org.infinispan.Cache cache = ...
javax.transaction.Transaction activeTransaction = ...
org.infinispan.transaction.TransactionTable txnTable = cache.getAdvancedCache().getComponentRegistry().getComponent(TransactionTable.class);
org.infinispan.transaction.xa.GlobalTransaction ispnTxID = txnTable.getLocalTransaction(activeTransaction).getGlobalTransaction();
{code}
We'd then use the {{GlobalTransaction}} in our {{@Listener}}:
{code}
@Listener
class TxnListener {
@TransactionCompleted
public void transactionCompleted( TransactionCompletedEvent event ) {
if ( !event.isOriginLocal ) return;
GlobalTransaction eventIspnTransaction = event.getGlobalTransaction();
if (eventIspnTransaction == null ||
ispnTxID.getId() != eventIspnTransaction.getId()) return;
if ( !event.isSuccessful() ) {
// do stuff
} else {
// do other stuff
}
}
{code}
However, this is no longer possible in Infinispan 7 since these classes were moved to an "impl" package.
Can we please have a public API to be notified when Infinispan has complete its work for a specific user transaction? It doesn't have to be like it was in 6, but ModeShape needs something (see MODE-2353 for details).
--
This message was sent by Atlassian JIRA
(v6.3.8#6338)
More information about the infinispan-issues
mailing list