docs: private BeanO allocateBeanO(ContainerTx tx)
                      throws RemoteException
      {
          BeanO result = null;
          long wait_time = beanMetaData.ivMaxCreationTimeout; // default is 5 minutes
          boolean beanAvailable = false;
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // d532639.2
  
          if (isTraceOn && tc.isDebugEnabled())
              Tr.debug(tc, "allocateBeanO: Obtaining HomeId lock for BeanPool : " + tx);
  
          lockStrategy.lock(container, tx, ivHomeId, LockManager.EXCLUSIVE);
  
          if (isTraceOn && tc.isDebugEnabled())
              Tr.debug(tc, "allocateBeanO: Obtained HomeId lock for BeanPool : " + tx);
  
          try
          {
              while (!beanAvailable)
              {
                  synchronized (beanPool)
                  {
                      result = (BeanO) beanPool.get();
  
                      if (result == null)
                      {
                          if (ivNumberBeansCreated < beanMetaData.ivMaxCreation)
                          {
                              beanAvailable = true;
                              ++ivNumberBeansCreated;
                              if (isTraceOn && tc.isDebugEnabled())
                                  Tr.debug(tc, "allocateBeanO: Not found in BeanPool(" +
                                               ivNumberBeansCreated + "/" +
                                               beanMetaData.ivMaxCreation +
                                               ") : creating new instance");
                          }
                          else
                          {
                              long wait_interval = Math.min(wait_time, BEAN_POOL_WAIT_INTERVAL);
                              if (wait_interval > 0) {
                                  if (isTraceOn && tc.isDebugEnabled())
                                      Tr.debug(tc, "allocateBeanO: Not found in BeanPool(" +
                                                   ivNumberBeansCreated + "/" + beanMetaData.ivMaxCreation +
                                                   ") : waiting for bean - " + wait_interval);
  
                                  beanPool.wait(wait_interval);
                                  wait_time -= wait_interval;
                              }
                          }
                      }
                      else
                      {
                          beanAvailable = true;
                          if (isTraceOn && tc.isDebugEnabled())
                              Tr.debug(tc, "allocateBeanO: Found in BeanPool(" +
                                           ivNumberBeansCreated + "/" +
                                           beanMetaData.ivMaxCreation + ") : " + result);
                      }
                  }
  
                  if (!beanAvailable)
                  {
                      homeEnabled();
                      if (tx.getGlobalRollbackOnly())
                      {
                          if (isTraceOn && tc.isDebugEnabled())
                              Tr.debug(tc, "allocateBeanO: Tx timeout waiting for bean " +
                                           "(" + (beanMetaData.ivMaxCreationTimeout - wait_time)
                                           + "): BeanPool(" + ivNumberBeansCreated + "/" +
                                           beanMetaData.ivMaxCreation + ")");
                          throw new CSITransactionRolledbackException("Transaction timed out or marked rolled back");
                      }
  
                      if (wait_time <= 0) // no time left to wait
                      {
                          if (isTraceOn && tc.isDebugEnabled())
                              Tr.debug(tc, "allocateBeanO: Wait timeout waiting for bean " +
                                           "(" + (beanMetaData.ivMaxCreationTimeout) +
                                           "): BeanPool(" + ivNumberBeansCreated + "/" +
                                           beanMetaData.ivMaxCreation + ")");
                          throw new EJBException("Instance of EJB " + j2eeName +
                                                 " not available : wait timeout");
                      }
                  }
              }
          } catch (InterruptedException iex)
          {
              FFDCFilter.processException(iex, CLASS_NAME + ".allocateBeanO",
                                          "919", this);
              ContainerEJBException ex = new ContainerEJBException
                              ("Instance of EJB " + j2eeName +
                               " not available : interrupted", iex);
              Tr.error(tc,
                       "CAUGHT_EXCEPTION_THROWING_NEW_EXCEPTION_CNTR0035E",
                       new Object[] { iex, ex.toString() });
              throw ex;
          } finally
          {
              if (isTraceOn && tc.isDebugEnabled())
                  Tr.debug(tc, "allocateBeanO: Releasing HomeId lock for BeanPool : " +
                               tx);
              lockStrategy.unlock(container, ivHomeId, tx);
          }
  
          return result;
      }