docs: private BeanO createBeanO(EJBThreadData threadData,
                                ContainerTx tx,
                                boolean activate,
                                ManagedObjectContext context)
                      throws RemoteException
      {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // d532639.2
  
          if (isTraceOn && tc.isEntryEnabled()) // d367572.7
              Tr.entry(tc, "createBeanO(ContainerTx, activate) activate = " + activate);
  
          homeEnabled();
          BeanO result = null;
  
          // -----------------------------------------------------------------------
          // For Stateless Session beans, the number of 'active' beans may
          // be limited.  The call to allocateBeanO will 'assign' one to this
          // thread and either return one from the pool, or return null to
          // indicate the pool is empty, but the limit is not currently in use
          // so one should be created. allocateBeanO will block and control will
          // NOT be returned until a BeanO has been allocated... or the attempt
          // has timed out, in which case an Exception will be thrown.       PK20648
          // -----------------------------------------------------------------------
          if (beanMetaData.ivMaxCreation > 0)
          {
              result = allocateBeanO(tx);
          }
          // -----------------------------------------------------------------------
          // F743-509.CodRev
          // Max creation limit is zero. Determine if is a Singleton session home.
          // A singleton session home never has a max creation limit since there
          // never is more than 1 Singleton instance created.
          // -----------------------------------------------------------------------
          else if (ivSingletonSessionHome) //d565527
          {
              result = createSingletonBeanO(); //F743-1753
          }
          // -----------------------------------------------------------------------
          // F743-509.CodRev
          // Neither a Stateless with a max creation limit nor a Singleton session bean
          // home.  If there is a bean pool, get an instance from the pool. Otherwise,
          // fall through and create a new one.
          // -----------------------------------------------------------------------
          else if (beanPool != null)
          {
              result = (BeanO) beanPool.get();
          }
  
          if (result == null) { // Create a new instance.
              if (statefulSessionHome && activate) // d367572.7
              {
                  try {
                      result = beanOFactory.create(container, this, true); // d367572.7
                  } catch (InvocationTargetException e) {
                      // we don't create the instance when reactivating, so ITE should not be thrown
                      FFDCFilter.processException(e, CLASS_NAME + ".createBeanO", "960", this);
                      throw new IllegalStateException(e);
                  }
              }
              else
              {
                  long createStartTime = -1;
                  try
                  {
                      // For Stateless and MessageDriven, create count is the same
                      // as instantiation count. For these types, create time should
                      // include creating the instance and calling any lifecycle
                      // callbacks.                                           d626533.1
                      if (pmiBean != null &&
                          (statelessSessionHome || messageDrivenHome))
                      {
                          createStartTime = pmiBean.initialTime(EJBPMICollaborator.CREATE_RT);
                      }
  
                      result = beanOFactory.create(container, this, false);
                  } catch (InvocationTargetException e) {
                      FFDCFilter.processException(e, CLASS_NAME + ".createBeanO", "977", this);
                      throw new RemoteException(enterpriseBeanClass.getName(), e.getCause());
                  } finally
                  {
                      // 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);
                      }
                  }
              }
          } else if (!activate
                     && beanMetaData.type == InternalConstants.TYPE_CONTAINER_MANAGED_ENTITY
                     && beanMetaData.cmpResetFields != null) {
              // Bean was obtained from pool and needs CMP instance values reset
              // to Java defaults
              EnterpriseBean b = result.getEnterpriseBean();
              for (int i = 0; i < beanMetaData.cmpResetFields.length; ++i) {
                  try {
                      java.lang.reflect.Field f = beanMetaData.cmpResetFields[i];
                      Class<?> clzz = f.getType();
                      if (clzz.isPrimitive()) {
                          if (clzz == Long.TYPE) {
                              f.setLong(b, 0);
                          } else if (clzz == Integer.TYPE) {
                              f.setInt(b, 0);
                          } else if (clzz == Boolean.TYPE) {
                              f.setBoolean(b, false);
                          } else if (clzz == Short.TYPE) {
                              f.setShort(b, (short) 0);
                          } else if (clzz == Byte.TYPE) {
                              f.setByte(b, (byte) 0);
                          } else if (clzz == Character.TYPE) {
                              f.setChar(b, (char) 0);
                          } else if (clzz == Double.TYPE) {
                              f.setDouble(b, 0);
                          } else if (clzz == Float.TYPE) {
                              f.setFloat(b, 0);
                          }
                      } else {
                          f.set(b, null);
                      }
                  } catch (IllegalAccessException iae) {
                      FFDCFilter.processException(iae, CLASS_NAME + ".createBeanO",
                                                  "598", this);
                      throw new ContainerException("Problem occurred resetting CMP fields to Java default values",
                                      iae);
                  }
              }
          }
  
          // -----------------------------------------------------------------------
          // Set the created/found BeanO as the 'Callback' BeanO, as this is the
          // BeanO that is becoming the active beanO for the thread.
          // This will allow methods called by customer code (like Timer methods)
          // to determine the state of the BeanO that is making the call     d168509
          // -----------------------------------------------------------------------
          threadData.pushCallbackBeanO(result); // d630940
  
          if (isTraceOn && tc.isEntryEnabled()) // d367572.7 d402055
              Tr.exit(tc, "createBeanO(ContainerTx, activate) activate = " + activate);
  
          return result;
      }