docs: private void uninstallBean(BeanMetaData bmd, boolean terminate) throws ContainerException {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // d532639.2
  
          J2EEName beanHomeName = bmd.j2eeName;
          if (isTraceOn && tc.isEntryEnabled())
              Tr.entry(tc, "uninstallBean : " + beanHomeName);
  
          //89188
          // If the BeanMetaData is not in the internal store, then we only need to
          // remove the HomeRecord.
          if (!internalBeanMetaDataStore.containsKey(bmd.j2eeName)) {
              homeOfHomes.removeHome(bmd); // F743-26072
  
              if (isTraceOn && tc.isEntryEnabled()) // d402055
                  Tr.exit(tc, "uninstallBean"); // d402055
              return;
          }
  
          // A failure has been reported in the code below that could only occur
          // if the two BMDs are out of synch, so the following FFDC is designed
          // to detect that state and collect possibly useful information.   PM65053
          BeanMetaData ibmd = internalBeanMetaDataStore.get(bmd.j2eeName);
          if (bmd != ibmd) {
              Exception isex = new IllegalStateException("Mismatch in internal bean metadata : " + bmd.j2eeName);
              FFDCFilter.processException(isex, CLASS_NAME + ".uninstallBean", "1500",
                                          this, new Object[] { bmd, ibmd });
          }
  
          //479980: Simply moved the 'try' to here from down below.  This move is necessary to properly handle the case
          //where a ContainerException is thrown in the next couple lines below.  If this exception is going to be thrown,
          //we should still perform the code contained in the 'finally' block which corresponds to this 'try' block.
          EJSHome home = null;
          try //202018
          {
              // First, remove the home from the HomeOfHomes to prevent any further
              // lookups of this home, and prevent any of the shutdown of the home
              // that is about to be perfomed from being undone. For example, the
              // wrappers should not be put back in the wrapper cache after being
              // removed below.                                               d547849
              home = homeOfHomes.removeHome(bmd); // F743-26072
  
              // d608829.1 - The home might not exist if a failure occurred before
              // it was created.  Do not throw another (meaningless) exception.
              if (home != null) {
                  //PK65102 - Prior to this APAR defect, the call below to 'unregisterHome' was not performed for
                  //an MDB home.  This resulted in the home objects remaining in memory after the app containing the home
                  //was stopped.
                  try {
  
                      if (home.isMessageDrivenHome()) {
                          ((MDBInternalHome) home).deactivateEndpoint(); //LI2110.41
                      }
                  } catch (Throwable e) { // d138839
                      FFDCFilter.processException(e, CLASS_NAME + ".uninstallBean", "988", this);
                  }
  
                  try {
                      // If the container is being terminated , cost of passivating a
                      // cache full of stateful beans could be quite expensive.
                      if (!terminate)
                          activator.uninstallBean(beanHomeName);
                  } catch (Throwable e) {
                      FFDCFilter.processException(e, CLASS_NAME + ".uninstallBean", "1853", this);
                  }
  
                  home.destroy();
  
                  // F743-1751 - Unregister the home from the wrapper manager after uninstalling the bean
                  // from the activator and destroying the home since either could cause PreDestroy
                  // lifecycle interceptors to be called, which could cause wrappers to be registered.
                  try {
                      wrapperManager.unregisterHome(beanHomeName, home);
                  } catch (Throwable e) { // d138839
                      FFDCFilter.processException(e, CLASS_NAME + ".uninstallBean", "999", this);
                  }
              }
          } catch (Throwable t) {
              FFDCFilter.processException(t, CLASS_NAME + ".uninstallBean",
                                          "1430", this);
              ContainerEJBException ex = new ContainerEJBException("Failed to destroy the home.", t);
              Tr.error(tc,
                       "CAUGHT_EXCEPTION_THROWING_NEW_EXCEPTION_CNTR0035E",
                       new Object[] { t, ex.toString() });
              throw ex;
          } finally {
              internalBeanMetaDataStore.remove(beanHomeName);//d146239.5
  
              if (isTraceOn && tc.isEntryEnabled())
                  Tr.exit(tc, "uninstallBean");
          } //finally                                   //202018
      }