// Don't need to flush since the previous end will have done this
packet = new SessionXAStartMessage(xid);
}
else
{
throw new XAException(XAException.XAER_INVAL);
}
SessionXAResponseMessage response = (SessionXAResponseMessage)channel.sendBlocking(packet);
if (response.isError())
{
ClientSessionImpl.log.error("XA operation failed " + response.getMessage() +
" code:" +
response.getResponseCode());
throw new XAException(response.getResponseCode());
}
}
catch (HornetQException e)
{
// we can retry this only because we know for sure that no work would have been done
if (e.getCode() == HornetQException.UNBLOCKED)
{
try
{
SessionXAResponseMessage response = (SessionXAResponseMessage)channel.sendBlocking(packet);
if (response.isError())
{
ClientSessionImpl.log.error("XA operation failed " + response.getMessage() +
" code:" +
response.getResponseCode());
throw new XAException(response.getResponseCode());
}
}
catch (HornetQException e1)
{
// This should never occur
throw new XAException(XAException.XAER_RMERR);
}
}
// This should never occur
throw new XAException(XAException.XAER_RMERR);
}
}