code: @Override
      public ConnectionManager getConnectionManager(ResourceInfo refInfo, AbstractConnectionFactoryService svc) throws ResourceException {
  
          final boolean trace = TraceComponent.isAnyTracingEnabled();
          if (trace && tc.isEntryEnabled())
              Tr.entry(this, tc, "getConnectionManager", refInfo, svc);
  
          ConnectionManager cm;
          lock.readLock().lock();
          try {
              if (pm == null)
                  try {
                      // Switch to write lock for lazy initialization
                      lock.readLock().unlock();
                      lock.writeLock().lock();
  
                      if (pm == null)
                          createPoolManager(svc);
                  } finally {
                      // Downgrade to read lock for rest of method
                      lock.readLock().lock();
                      lock.writeLock().unlock();
                  }
  
              CMConfigData cmConfigData = getCMConfigData(svc, refInfo);
              String cfDetailsKey = cmConfigData.getCFDetailsKey();
              cm = cfKeyToCM.get(cfDetailsKey);
              if (cm == null) {
                  CommonXAResourceInfo xaResInfo = new EmbXAResourceInfo(cmConfigData);
                  J2CGlobalConfigProperties gConfigProps = pm.getGConfigProps();
                  synchronized (this) {
                      cm = cfKeyToCM.get(cfDetailsKey);
                      if (cm == null) {
                          cm = new ConnectionManager(svc, pm, gConfigProps, xaResInfo);
                          cfKeyToCM.put(cfDetailsKey, cm);
                      }
                  }
              }
  
          } finally {
              lock.readLock().unlock();
          }
  
          if (trace && tc.isEntryEnabled())
              Tr.exit(this, tc, "getConnectionManager", cm);
          return cm;
      }
docs: Returns the connection manager for this configuration.
  This method lazily initializes the connection manager service if necessary.
  
  @param ref reference to the connection factory.
  @param svc the connection factory service
  @return the connection manager for this configuration.
  @throws ResourceException if an error occurs