docs: private void doLookups(ClassLoader cl) {
        if (lookupFailed)
           return;
        InitialContext ctx;
        try {
           ctx = new InitialContext();
        }
        catch (NamingException e) {
           log.failedToCreateInitialCtx(e);
           lookupFailed = true;
           return;
        }
  
        try {
           //probe jndi lookups first
           for (LookupNames.JndiTransactionManager knownJNDIManager : LookupNames.JndiTransactionManager.values()) {
              Object jndiObject;
              try {
                 log.debugf("Trying to lookup TransactionManager for %s", knownJNDIManager.getPrettyName());
                 jndiObject = ctx.lookup(knownJNDIManager.getJndiLookup());
              }
              catch (NamingException e) {
                 log.debugf("Failed to perform a lookup for [%s (%s)]",
                           knownJNDIManager.getJndiLookup(), knownJNDIManager.getPrettyName());
                 continue;
              }
              if (jndiObject instanceof TransactionManager) {
                 tm = (TransactionManager) jndiObject;
                 log.debugf("Found TransactionManager for %s", knownJNDIManager.getPrettyName());
                 return;
              }
           }
        } finally {
           Util.close(ctx);
        }
  
        boolean found = true;
        // The TM may be deployed embedded alongside the app, so this needs to be looked up on the same CL as the Cache
        for (LookupNames.TransactionManagerFactory transactionManagerFactory : LookupNames.TransactionManagerFactory.values()) {
           log.debugf("Trying %s: %s", transactionManagerFactory.getPrettyName(), transactionManagerFactory.getFactoryClazz());
           TransactionManager transactionManager = transactionManagerFactory.tryLookup(cl);
           if (transactionManager != null) {
              log.debugf("Found %s: %s", transactionManagerFactory.getPrettyName(), transactionManagerFactory.getFactoryClazz());
              tm = transactionManager;
              found = false;
           }
        }
        lookupDone = true;
        lookupFailed = found;
     }