@Override
public void dtxStart(ServerSession session, DtxStart method)
{
XaResult result = new XaResult();
result.setStatus(DtxXaStatus.XA_OK);
try
{
session.startDtx(method.getXid(), method.getJoin(), method.getResume());
session.executionResult(method.getId(), result);
}
catch(JoinAndResumeDtxException e)
{
exception(session, method, ExecutionErrorCode.COMMAND_INVALID, e.getMessage());
}
catch(UnknownDtxBranchException e)
{
exception(session, method, ExecutionErrorCode.NOT_ALLOWED, "Unknown xid " + method.getXid());
}
catch(AlreadyKnownDtxException e)
{
exception(session, method, ExecutionErrorCode.NOT_ALLOWED, "Xid already started an neither join nor " +
"resume set" + method.getXid());
}
catch(DtxNotSelectedException e)
{
exception(session, method, ExecutionErrorCode.COMMAND_INVALID, e.getMessage());
}
}