Future<XaResult> future = _xaSession.getQpidSession()
.dtxStart(convertXid(xid),
flag == XAResource.TMJOIN ? Option.JOIN : Option.NONE,
flag == XAResource.TMRESUME ? Option.RESUME : Option.NONE);
// now wait on the future for the result
XaResult result = null;
try
{
result = future.get();
}
catch (SessionException e)
{
// we need to restore the qpid session that has been closed
_xaSession.createSession();
convertExecutionErrorToXAErr(e.getException().getErrorCode());
// TODO: The amqp spec does not allow to make the difference
// between an already known XID and a wrong arguments (join and resume are set)
// TODO: make sure amqp addresses that
}
checkStatus(result.getStatus());
_xid = xid;
if (_timeout > 0)
{
setDtxTimeout(_timeout);
}