*/
public Xid[] recover(int flag) throws XAException
{
// the flag is ignored
Future<RecoverResult> future = _xaSession.getQpidSession().dtxRecover();
RecoverResult res = null;
try
{
res = future.get();
}
catch (SessionException e)
{
// we need to restore the qpid session that has been closed
_xaSession.createSession();
convertExecutionErrorToXAErr( e.getException().getErrorCode());
}
Xid[] result = new Xid[res.getInDoubt() != null ? res.getInDoubt().size() : 0];
if(result.length != 0)
{
int i = 0;
for (Object obj : res.getInDoubt())
{
org.apache.qpid.transport.Xid xid = (org.apache.qpid.transport.Xid) obj;
result[i] = new XidImpl(xid.getBranchId(), (int) xid.getFormat(), xid.getGlobalId());
i++;
}