code: public void addPersistenceUnits(JPAPXml pxml) {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
          if (isTraceOn && tc.isDebugEnabled())
              Tr.debug(tc, "addPersistenceUnits", pxml);
  
          JPAPuScope puScope = pxml.getPuScope();
          String scopeKey = (puScope == JPAPuScope.EAR_Scope) ? EAR_SCOPE_MODULE_NAME : pxml.getArchiveName();
  
          JPAScopeInfo scopeInfo = null;
          synchronized (puScopes) {
              scopeInfo = puScopes.get(scopeKey);
              if (scopeInfo == null) {
                  scopeInfo = new JPAScopeInfo(scopeKey, puScope);
                  puScopes.put(scopeKey, scopeInfo);
              }
          }
  
          // delegate to scopeInfo to read in the persistence-unit data
          JPAIntrospection.beginPUScopeVisit(scopeInfo);
          try {
              scopeInfo.processPersistenceUnit(pxml, this);
          } finally {
              JPAIntrospection.endPUScopeVisit();
          }
      }
docs: Adds all of the Persistence Units defined in the specified
  persistence.xml file to the application, sorting by scope
  and archive name. <p>
  
  @param pxml provides access to a persistence.xml file as well
  as the archive name and scope.