docs: public void removeBean(EJSWrapperBase w) throws RemoteException, RemoveException {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // d532639.2
  
          // Beans that have been configured with a reload interval, and are
          // therefore ReadOnly, may not be removed. However this is not
          // considered a rollback situation, so throw a checked exception.   LI3408
          if (w.bmd.ivCacheReloadType != BeanMetaData.CACHE_RELOAD_NONE) {
              if (isTraceOn && tc.isDebugEnabled())
                  Tr.debug(tc, "RemoveException: Read only EJB may not be removed.");
  
              throw new RemoveException("Read only EJB may not be removed.");
          }
  
          // If this is a business interface, then it may not have a remove method
          // and if it does, it may take parameters that aren't available. So, for
          // business interfaces, an internal method is used that doesn't actually
          // call a method on the bean, but acts like a remove method. If this is
          // a component interface, then perform the normal remove processing that
          // is required for EJBObject/EJBLocalObject remove.             F743-29185
          //
          // We cannot easily share a "fake" remove EJBMethodInfo for both component
          // business due to the differences in PMI and enlisted remove.     d742761
          int methodId = MID_BUSINESS_REMOVE;
          if (w.ivInterface == WrapperInterface.LOCAL ||
              w.ivInterface == WrapperInterface.REMOTE) {
              methodId = w.methodInfos.length - 1;
          }
  
          //------------------------------------------------------------------------
          // Remove is modelled after bean interface method, with
          // similar pre/postInvoke behavior, but since remove requires
          // special interaction with container it is not identical.
          //------------------------------------------------------------------------
  
          EJSDeployedSupport s = new EJSDeployedSupport(); // d630940
          boolean isStateless = isStatelessSessionBean(w.beanId); // d115455
  
          try {
              if (isTraceOn && tc.isEntryEnabled())
                  Tr.entry(tc, "removeBean(wrapperBase) : " + w.beanId);
              EjbPreInvoke(w, methodId, s, new Object[0]); // LIDB2167.11 d369262.6
  
              // For component interfaces, EJSWrapper/EJSLocalWrapper.remove() calls
              // this method, so we call BeanO.remove() to remove the bean.
              //
              // For business interface @Remove methods, the generated wrapper needs
              // to call the bean rather than this method, so BeanO.remove() is
              // called indirectly via BeanO.commit().  This method can still be
              // called for CDI remove, so we still rely on BeanO.commit() rather
              // than explicitly calling BeanO.remove() here for proper PMI handling.
              if (methodId == MID_BUSINESS_REMOVE) {
                  // Set the bean in the current tx for removal after the transaction
                  // completes.  This would normally be set during postInvoke, but the
                  // temporary EJBMethodInfoImpl isn't marked setSFSBRemove (perhaps
                  // because extra cleanup would be required when putting it back in
                  // the temporary pool).
                  s.currentTx.ivRemoveBeanO = s.beanO; // F743-29185
              } else {
                  s.beanO.remove();//d140003.19
              }
  
              //---------------------------------------------------------------------
              // Don't unregister stateless session bean instances, since there
              // is a single wrapper instance for many bean instances.
              //
              // Don't unregister if this method invokation did not pin the Wrapper
              // in the Wrapper Cache.  This may occur if another thread is also
              // calling a method on the wrapper, or if this is a reentrant call
              // to remove.                                                   d147604
              //---------------------------------------------------------------------
  
              if (!isStateless &&
                  s.unpinOnPostInvoke == true) {
                  boolean removed = wrapperManager.unregister(w.beanId, true); //d181569
                  if (removed)
                      s.unpinOnPostInvoke = false; // d140003.19
              }
              // d115455 begin
          } catch (UnknownException ex) {
              // When current invocation is executed within another Tx scope, an
              // BeanNotReentrantException will be thrown. The remote exception mapping
              // mechanism will turns the BeanNotReentrantException to an UnknownException.
              FFDCFilter.processException(ex, CLASS_NAME + ".removeBean", "1589", this);
              if ((isStateless || isStatefulSessionBean(w.beanId)) &&
                  ex.originalEx instanceof BeanNotReentrantException) {
  
                  // section 7.6.4 - It is an error for a client to invoke the remove
                  //  method on the sessionobject's home or component interface object
                  //  if a session bean instance is participating in a transaction.
                  RemoveException rex = new RemoveException(ex.originalEx.toString());
                  s.setCheckedException(rex);//d140003.19
                  throw rex;
              } else {
                  // treats the reentrant exceptoin like Throwable exception
                  s.setUncheckedException(ex);
              }
              // d115455 end
              // d171551 Begins
          } catch (EJBException ejbex) {
              // When current invocation is executed within another Tx scope, an
              // BeanNotReentrantException will be thrown. The local exception mapping
              // mechanism will turns the BeanNotReentrantException to an EJBException.
              FFDCFilter.processException(ejbex, CLASS_NAME + ".removeBean", "2077", this);
              if ((isStateless || isStatefulSessionBean(w.beanId)) &&
                  ejbex.getCausedByException() instanceof BeanNotReentrantException) {
  
                  // section 7.6.4 - It is an error for a client to invoke the remove
                  //  method on the sessionobject's home or component interface object
                  //  if a session bean instance is participating in a transaction.
                  RemoveException rex = new RemoveException(ejbex.getCausedByException().toString());
                  s.setCheckedException(rex);
                  throw rex;
              } else {
                  // treats the reentrant exception like Throwable exception
                  s.setUncheckedException(ejbex);
              }
              // d171551 Ends
  
          } catch (RemoveException ex) {
              FFDCFilter.processException(ex, CLASS_NAME + ".removeBean", "1605", this);
              s.setCheckedException(ex);//d140003.19
              throw ex;
          } catch (RemoteException ex) {
              FFDCFilter.processException(ex, CLASS_NAME + ".removeBean", "1609", this);
              s.setUncheckedException(ex); // c154712
              throw ex;
          } catch (Throwable ex) {
              FFDCFilter.processException(ex, CLASS_NAME + ".removeBean", "1612", this);
              s.setUncheckedException(ex);
          } finally {
              try {
                  postInvoke(w, methodId, s);
              } finally {
                  putEJSDeployedSupport(s); // d742761
              }
              if (isTraceOn && tc.isEntryEnabled())
                  Tr.exit(tc, "removeBean(wrapperBase)");
          }
      }