docs: private DataSource getJPADataSource(String dsName) {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
          if (isTraceOn && tc.isEntryEnabled())
              Tr.entry(tc, "getJPADataSource : " + dsName + ", " + ivArchivePuId);
  
          DataSource ds = null;
  
          if (dsName != null) {
              try {
                  // If the 'base' EM Factory has not been set yet, then the
                  // application is starting and a java:comp/env datasource cannot
                  // be resolved. So, just return a 'generic' datasource, that should
                  // satisfy the provider, though will never actually be used. d510184
                  if (ivEMFactory == null &&
                      (dsName.startsWith(JNDI_NAMESPACE_JAVA_COMP_ENV) ||
                       dsName.startsWith(JNDI_NAMESPACE_JAVA_APP_ENV))) {
                      ds = new GenericDataSource(ivArchivePuId, dsName);
                  }
  
                  // Otherwise, the component context should be set, or this is a
                  // datasource in the global namespace; look it up now.       d510184
                  else {
                      ds = lookupDataSource(dsName);
                  }
              } catch (NamingException ex) {
                  // If the 'base' EM Factory has not been set yet, then the
                  // application is starting and we will defer the logging of
                  // the missing DataSource until the PU is first used...      d543082
                  if (ivEMFactory == null) {
                      if (isTraceOn && tc.isDebugEnabled())
                          Tr.debug(tc, "getJPADataSource : failed, " +
                                       "returning GenericDataSource : " + ex);
                      ds = new GenericDataSource(ivArchivePuId, dsName);
                  } else if (getJPAComponent().isIgnoreDataSourceErrors()) {
                      Tr.error(tc, "UNABLE_TO_GET_DATASOURCE_FOR_PU_CWWJP0013E",
                               dsName, ivArchivePuId.getPuName(), ex.toString());
                  } else {
                      // Throw an exception, which will hopefully propagate through the
                      // persistence provider.                                RTC114812
                      String message = Tr.formatMessage(tc, "UNABLE_TO_GET_DATASOURCE_FOR_PU_CWWJP0013E",
                                                        dsName, ivArchivePuId.getPuName(), ex.toString());
                      PersistenceException ex2 = new PersistenceException(message, ex);
  
                      if (isTraceOn && tc.isEntryEnabled())
                          Tr.exit(tc, "getJPADataSource", ex2);
                      throw ex2;
                  }
              }
          } //if (dsName != null) {
  
          if (isTraceOn && tc.isEntryEnabled())
              Tr.exit(tc, "getJPADataSource : " + ds);
          return ds;
      }