docs: public Xid[] recover() throws XAResourceNotAvailableException, SystemException
      {
          if (tc.isEntryEnabled()) Tr.entry(tc, "recover", _XARes);
  
          Xid[] returnedXidArray = null;
  
          if (_XARes != null)
          {
              final int flags = (XAResource.TMSTARTRSCAN | XAResource.TMENDRSCAN);
              if (tc.isDebugEnabled())
              {
                  Tr.debug(tc, "Driving xares.recover() on resource with flags",
                               new Object[]{_XARes, Util.printFlag(flags)});
              }
              try
              {
                  returnedXidArray = _XARes.recover(flags);
              }
              catch (XAException xae)
              {
                  FFDCFilter.processException(
                      xae,
                      this.getClass().getName() + ".recover",
                      "109",
                      this);
                  final int errorCode = xae.errorCode;
                  if (errorCode == XAException.XAER_RMFAIL)
                  {
                      /*-----------------------------------------------------*/
                      /* The resource manager is now not available.  We will */
                      /* have to try again later.                            */
                      /*-----------------------------------------------------*/
                      Tr.warning(tc, "WTRN0037_XA_RECOVER_ERROR", new Object[]
                          {_XARes, XAReturnCodeHelper.convertXACode(errorCode), xae});
                      throw new XAResourceNotAvailableException(xae);
                  }
                  else if (errorCode == XAException.XAER_RMERR)
                  {
                      /*-----------------------------------------------------*/
                      /* The resource manager has failed.  We will have to   */
                      /* try again later.                                    */
                      /*-----------------------------------------------------*/
                      Tr.error(tc, "WTRN0037_XA_RECOVER_ERROR", new Object[]
                          {_XARes, XAReturnCodeHelper.convertXACode(errorCode), xae});
                
                      Class<? extends XAException> c = xae.getClass();
                      // Oracle returns -3 too often and other information via
                      // its own exception, so get that
                      if (c.getName().equals("oracle.jdbc.xa.OracleXAException"))
                      {
                          try
                          {
                              final Method m = c.getMethod("getOracleError", (Class[])null);
                              final Integer result = (Integer) m.invoke(c, (Object[])null);
                              Tr.error(tc, "WTRN0100_GENERIC_ERROR", 
                                  "Oracle error returned - " + result.intValue());
                          }
                          catch (Throwable e) { }
                      }
                      // Retry as restarting the RM may fix the problem
                      throw new XAResourceNotAvailableException(xae);
                  }
                  else if (errorCode == XAException.XAER_INVAL)
                  {
                      /*-----------------------------------------------------*/
                      /* Sometimes Informix gets upset when you call start   */
                      /* and end scan at the same time.                      */
                      /*-----------------------------------------------------*/
                      Xid[] array1 = null;
                      Xid[] array2 = null;
                      try
                      {
                          /*-------------------------------------------------*/
                          /* Try calling start and end separately, and       */
                          /* merging the responses.                          */
                          /*-------------------------------------------------*/
                          array1 = _XARes.recover(XAResource.TMSTARTRSCAN);
                          array2 = _XARes.recover(XAResource.TMENDRSCAN);
  
                          if (array1 == null) array1 = new Xid[0];
  
                          if (array2 == null) array2 = new Xid[0];
  
                          returnedXidArray =
                              new Xid[array1.length + array2.length];
  
                          for (int x = 0; x < array1.length; x++)
                          {
                              returnedXidArray[x] = array1[x];
                          }
  
                          for (int x = 0; x < array2.length; x++)
                          {
                              returnedXidArray[x + array1.length] = array2[x];
                          }
                      }
                      catch (Throwable t)
                      {
                          if (tc.isEventEnabled())
                          {
                              Tr.event(tc, "Caught exception re-driving " +
                                       "recover", t);
                          }
  
                          /*-------------------------------------------------*/
                          /* It obviously wasn't Informix, or something else */
                          /* went wrong...                                   */
                          /*-------------------------------------------------*/
                          Tr.error(tc, "WTRN0037_XA_RECOVER_ERROR", new Object[]
                              {_XARes, XAReturnCodeHelper.convertXACode(errorCode), xae});
                          throw new SystemException();
                      }
                  }
                  else /* PROTO */
                  {
                      /*-----------------------------------------------------*/
                      /* WebSphere drove the resource manager for recovery   */
                      /* in an improper context.  Either we are in an        */
                      /* invalid state or the resource manager has           */
                      /* encountered an error which he probably won't        */
                      /* recover from.                                       */
                      /*-----------------------------------------------------*/
                      Tr.error(tc, "WTRN0037_XA_RECOVER_ERROR", new Object[]
                          {_XARes, XAReturnCodeHelper.convertXACode(errorCode), xae});
                      throw new SystemException();
                  }
              }
              catch (Throwable t)
              {
                  /*---------------------------------------------------------*/
                  /* The resource manager threw some other funny exception   */
                  /* that we weren't expecting.  We should probably try to   */
                  /* call the resouce manager again later...                 */
                  /* TODO: Throw same exception as resource not available.   */
                  /*---------------------------------------------------------*/
                  FFDCFilter.processException(
                      t,
                      this.getClass().getName() + ".recover",
                      "149",
                      this);
                  if (tc.isDebugEnabled())
                  {
                      Tr.debug(tc, "Resource {0} threw unexpected exception",
                               new Object[] {_XARes, t});
                  }
                  throw new XAResourceNotAvailableException(new Exception(t));
              }
          }
  
          if (returnedXidArray == null)
          {
              returnedXidArray = new Xid[0];
          }
  
          if (tc.isEntryEnabled()) Tr.exit(tc, "recover");
          return returnedXidArray;
      }