code: @Override
      public final synchronized void beforeCompletion()
                      throws RemoteException
      {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
          if (isTraceOn && tc.isEntryEnabled())
              Tr.entry(tc, "beforeCompletion: " + getStateName(state), currentTx); //123293
  
          if (removed) {
              if (isTraceOn && tc.isEntryEnabled())
                  Tr.exit(tc, "beforeCompletion: removed");
              return;
          }
  
          switch (state)
          {
              case TX_METHOD_READY:
                  setState(COMMITTING_OUTSIDE_METHOD);
                  break;
  
              case TX_IN_METHOD:
                  setState(COMMITTING_IN_METHOD);
                  break;
  
              // Could happen during async rollback
              case IN_METHOD:
              case METHOD_READY:
              case DESTROYED:
                  if (isTraceOn && tc.isEntryEnabled())
                      Tr.exit(tc, "beforeCompletion: asynch rollback: " + getStateName(state));
                  return;
  
              default:
                  if (isTraceOn && tc.isDebugEnabled()) // d144064
                      Tr.debug(tc, "invalid state: " + state); //123293
                  throw new InvalidBeanOStateException(StateStrs[state],
                                  "TX_IN_METHOD | " +
                                                  "TX_METHOD_READY");
  
          }
  
          if (isTraceOn && tc.isEntryEnabled())
              Tr.exit(tc, "beforeCompletion: " + getStateName(state));
  
      }
docs: Ensure that this <code>StatefulBeanO</code> is prepared
  for transaction completion. <p>