docs: public synchronized BeanO createSingletonBeanO()
      {
          boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
          if (isTraceOn && tc.isEntryEnabled())
              Tr.entry(tc, "createSingletonBeanO: " + j2eeName);
  
          // F743-4950 - This check is done (unsynchronized) from createBeanO, but
          // it also needs to happen for dependencies.
          homeEnabled();
  
          BeanO result = null;
          if (ivSingletonBeanO == null)
          {
              if (ivCreatingSingletonBeanO)
              {
                  if (isTraceOn && tc.isEntryEnabled())
                      Tr.exit(tc, "createSingletonBeanO: IllegalLoopbackException");
                  throw new IllegalLoopbackException("Cannot call a method on a singleton session bean while " +
                                                     "constructing the bean instance : " + j2eeName);
              }
  
              // F7434950.CodRev - The EG has decided that the container must only
              // attempt to initialize a singleton once.
              // d632115 - and the required exception is NoSuchEJBException.
              if (ivSingletonBeanOCreateFailed)
              {
                  if (isTraceOn && tc.isEntryEnabled())
                      Tr.exit(tc, "createSingletonBeanO: NoSuchEJBException - prior failure");
                  throw ExceptionUtil.NoSuchEJBException
                                  ("An error occurred during a previous attempt to initialize the " +
                                   "singleton session bean " + j2eeName + ".", null);
              }
  
              // F743-4950 - Avoid direct (or indirect) attempts to use this
              // singleton before it has finished initializing.
              ivCreatingSingletonBeanO = true;
  
              try
              {
                  // If anything below this point fails, then any subsequent attempts
                  // to create the bean instance must also fail.               d632115
                  ivSingletonBeanOCreateFailed = true; // F7434950.CodRev
  
                  // F743-20281 - Resolve dependencies.
                  List<J2EEName> dependsOn;
                  try
                  {
                      dependsOn = beanMetaData._moduleMetaData.getEJBApplicationMetaData().resolveBeanDependencies(beanMetaData);
                  } catch (RuntimeWarning rw)
                  {
                      if (isTraceOn && tc.isDebugEnabled())
                          Tr.debug(tc, "dependency resolution error", rw);
                      throw ExceptionUtil.NoSuchEJBException(rw.getMessage(), rw);
                  }
  
                  // F743-4950 - Initialize dependencies before this singleton.
                  if (dependsOn != null) // F743-20281
                  {
                      for (J2EEName dependency : dependsOn) // F743-20281
                      {
                          if (isTraceOn && tc.isDebugEnabled())
                              Tr.debug(tc, "initializing dependency " + dependency);
  
                          try
                          {
                              EJSHome dependencyHome = (EJSHome) EJSContainer.homeOfHomes.getHome(dependency);
                              dependencyHome.createSingletonBeanO();
                          } catch (Throwable t)
                          {
                              if (isTraceOn && tc.isDebugEnabled())
                                  Tr.exit(tc, "createSingletonBeanO: failed to initialize dependency",
                                          t);
                              // d632115 - required exception is NoSuchEJBException.
                              throw ExceptionUtil.NoSuchEJBException
                                              ("Failed to initialize singleton session bean " + j2eeName +
                                               " because the dependency " + dependency +
                                               " failed to initialize.", t);
                          }
                      }
                  }
  
                  // Now that dependencies have been initialized, add the singleton
                  // to the initialization list.  It doesn't matter if initialization
                  // fails since addInitializedSingleton is idempotent, and we really
                  // only care that the initialization is recorded for this home at
                  // some point after it is recorded for all its dependencies.
                  beanMetaData._moduleMetaData.getEJBApplicationMetaData().addSingletonInitialization(this);
  
                  long createStartTime = -1;
                  Object oldClassLoader = ThreadContextAccessor.UNCHANGED; // d627931
                  try
                  {
                      // For Singleton, create time should include creating the
                      // instance and calling any lifecycle callbacks.        d626533.1
                      if (pmiBean != null)
                      {
                          createStartTime = pmiBean.initialTime(EJBPMICollaborator.CREATE_RT);
                      }
  
                      // To support injection, etc. we must put the bmd and classloader
                      // on the thread.   // d627931
                      ivCMDAccessor.beginContext(beanMetaData);
                      oldClassLoader = EJBThreadData.svThreadContextAccessor.pushContextClassLoaderForUnprivileged(beanMetaData.ivContextClassLoader); // F85059
  
                      ivSingletonBeanO = (SingletonBeanO) beanOFactory.create(container, this, false);
                      ivSingletonBeanOCreateFailed = false; // F7434950.CodRev
                  } catch (Throwable t)
                  {
                      FFDCFilter.processException(t, CLASS_NAME + ".createBeanO", "1047", this);
                      if (t instanceof InvocationTargetException)
                      {
                          t = t.getCause();
                      }
                      // F743-1751CodRev - Always wrap the exception in EJBException to
                      // satisfy the contract of preInvokeForLifecycleInterceptors.
                      // d632115 - and the required exception is NoSuchEJBException.
                      String msgTxt = "An error occurred during initialization of singleton session bean " +
                                      j2eeName + ", resulting in the discarding of the singleton instance.";
                      throw ExceptionUtil.NoSuchEJBException(msgTxt, t);
                  } finally // d627931
                  {
                      EJBThreadData.svThreadContextAccessor.popContextClassLoaderForUnprivileged(oldClassLoader);
                      ivCMDAccessor.endContext();
  
                      // Even if the create fails, go ahead and add the time, so
                      // the number of times counted matches the create count.
                      if (createStartTime > -1)
                      {
                          pmiBean.finalTime(EJBPMICollaborator.CREATE_RT, createStartTime);
                      }
                  }
  
              } finally
              {
                  ivCreatingSingletonBeanO = false;
              }
          }
  
          // Return the cached Singleton instance.
          result = ivSingletonBeanO;
  
          if (isTraceOn && tc.isEntryEnabled())
              Tr.exit(tc, "createSingletonBeanO");
          return result;
      }