SessionXAPrepareMessage packet = new SessionXAPrepareMessage(xid);
startCall();
try
{
SessionXAResponseMessage response = (SessionXAResponseMessage)channel.sendBlocking(packet);
if (response.isError())
{
throw new XAException(response.getResponseCode());
}
else
{
xaRetry = false;
return response.getResponseCode();
}
}
catch (HornetQException e)
{
if (e.getType() == HornetQExceptionType.UNBLOCKED)
{
// Unblocked on failover
try
{
HornetQClientLogger.LOGGER.failoverDuringPrepare();
SessionXAResponseMessage response = (SessionXAResponseMessage)channel.sendBlocking(packet);
if (response.isError())
{
throw new XAException(response.getResponseCode());
}
xaRetry = false;
return response.getResponseCode();
}
catch (HornetQException e1)
{
// ignore and rollback
}