/** * Returns the {@link org.infinispan.transaction.xa.TransactionXaAdapter} corresponding to the * supplied transaction. If none exists, will be created first. */ public LocalTransaction getOrCreateLocalTransaction( Transaction transaction, TxInvocationContext ctx) { LocalTransaction current = localTransactions.get(transaction); if (current == null) { Address localAddress = rpcManager != null ? rpcManager.getTransport().getAddress() : null; GlobalTransaction tx = txFactory.newGlobalTransaction(localAddress, false); current = txFactory.newLocalTransaction( transaction, tx, ctx.isImplicitTransaction(), currentViewId); log.tracef("Created a new local transaction: %s", current); localTransactions.put(transaction, current); notifier.notifyTransactionRegistered(tx, ctx); } return current; }
/** * Returns the {@link org.infinispan.transaction.xa.TransactionXaAdapter} corresponding to the * supplied transaction. If none exists, will be created first. */ public LocalTransaction getOrCreateLocalTransaction( Transaction transaction, boolean implicitTransaction) { LocalTransaction current = localTransactions.get(transaction); if (current == null) { Address localAddress = rpcManager != null ? rpcManager.getTransport().getAddress() : null; GlobalTransaction tx = txFactory.newGlobalTransaction(localAddress, false); current = txFactory.newLocalTransaction(transaction, tx, implicitTransaction, currentTopologyId); if (trace) log.tracef("Created a new local transaction: %s", current); localTransactions.put(transaction, current); globalToLocalTransactions.put(current.getGlobalTransaction(), current); notifier.notifyTransactionRegistered(tx, true); } return current; }