code: @Override
      public final synchronized void commit(ContainerTx tx)
                      throws RemoteException
      {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
          if (isTraceOn && tc.isEntryEnabled())
              Tr.entry(tc, "commit: " + getStateName(state), tx);
  
          if (removed) {
              if (isTraceOn && tc.isEntryEnabled())
                  Tr.exit(tc, "commit: removed");
              return;
          }
  
          if (tx.ivRemoveBeanO == this)
          {
              completeRemoveMethod(tx); // d647928
          }
          else
          {
              // Perform normal afterCompletion processing.... calling
              // afterCompletion if present.
              setState(COMMITTING_OUTSIDE_METHOD, AFTER_COMPLETION); // d159152
  
              // Session Synchronization AfterCompletion needs to be called if either
              // the annotation (or XML) was specified or the bean implemented
              // the interface and a global transaction is active.        F743-25855
              if ((ivAfterCompletion != null || sessionSync != null) &&
                  tx.isTransactionGlobal())
              {
                  EJBThreadData threadData = EJSContainer.getThreadData();
  
                  threadData.pushContexts(this);
                  try
                  {
                      if (ivAfterCompletion != null) {
                          invokeSessionSynchMethod(ivAfterCompletion, new Object[] { true });
                      } else {
                          sessionSync.afterCompletion(true);
                      }
                  } finally
                  {
                      threadData.popContexts();
                  }
              }
  
              setState(AFTER_COMPLETION, METHOD_READY); // d159152
          }
  
          // currentTx is now reset in atCommit/atRollback AFTER the final pin
          // is undone.                                                      d258770
          // currentTx = null;                                            // PQ99986
  
          if (isTraceOn && tc.isEntryEnabled())
              Tr.exit(tc, "commit: " + getStateName(state));
      }
docs: Inform this <code>SessionBeanO</code> that the transaction
  it was enlisted with has committed. <p>