added Openwire XA end call

This commit is contained in:
Andy Taylor 2015-07-28 09:06:40 +01:00 committed by Clebert Suconic
parent d002da8506
commit abcde1c1f3
3 changed files with 25 additions and 0 deletions

View File

@ -1356,6 +1356,7 @@ public class OpenWireConnection implements RemotingConnection, CommandVisitor
@Override
public Response processEndTransaction(TransactionInfo info) throws Exception
{
protocolManager.endTransaction(info);
TransactionId txId = info.getTransactionId();
if (!txMap.containsKey(txId))

View File

@ -711,6 +711,17 @@ public class OpenWireProtocolManager implements ProtocolManager<Interceptor>, No
server.destroyQueue(new SimpleString(q));
}
public void endTransaction(TransactionInfo info) throws Exception
{
AMQSession txSession = transactions.get(info.getTransactionId());
if (txSession != null)
{
txSession.endTransaction(info);
}
}
public void commitTransactionOnePhase(TransactionInfo info) throws Exception
{
AMQSession txSession = transactions.get(info.getTransactionId());

View File

@ -396,6 +396,19 @@ public class AMQSession implements SessionCallback
this.isTx = true;
}
public void endTransaction(TransactionInfo info) throws Exception
{
checkTx(info.getTransactionId());
if (txId.isXATransaction())
{
XATransactionId xid = (XATransactionId) txId;
XidImpl coreXid = new XidImpl(xid.getBranchQualifier(), xid.getFormatId(), xid.getGlobalTransactionId());
this.coreSession.xaEnd(coreXid);
}
}
public void commitOnePhase(TransactionInfo info) throws Exception
{
checkTx(info.getTransactionId());