docs: public synchronized void commit() throws HeuristicRollbackException, HeuristicMixedException, HeuristicHazardException, SystemException {
          if (tc.isEntryEnabled())
              Tr.entry(tc, "commit", this);
  
          // Ensure in-doubt timeout cannot complete the underlying transaction
          try {
              ((DistributableTransaction) _transaction).addAssociation();
          } catch (TRANSACTION_ROLLEDBACK ex) {
              // convert this to TRANSIENT as we want caller to retry
              if (tc.isDebugEnabled())
                  Tr.debug(tc, "Server busy: throwing TRANSIENT to force retry", ex);
              final TRANSIENT te = new TRANSIENT(MinorCode.SERVER_BUSY, Boolean.FALSE);
              if (tc.isEntryEnabled())
                  Tr.exit(tc, "commit", te);
              throw te;
          }
  
          boolean sysException = false;
  
          // Cancel any outstanding in-doubt timer
          EmbeddableTimeoutManager.setTimeout(_transaction, EmbeddableTimeoutManager.CANCEL_TIMEOUT, 0);
  
          final int state = _transaction.getTransactionState().getState();
          switch (state) {
              case TransactionState.STATE_PREPARED:
                  try {
                      _transaction.getTransactionState().setState(TransactionState.STATE_COMMITTING);
                  } catch (javax.transaction.SystemException se) {
                      FFDCFilter.processException(se, "com.ibm.tx.remote.TransactionWrapper.commit", "354", this);
                      if (tc.isDebugEnabled())
                          Tr.debug(tc, "Exception caught setting state to COMMITTING!", se);
                      sysException = true;
                  }
  
                  try {
                      // Resume the transaction created from the incoming
                      // request so that it is installed on the thread.
                      ((EmbeddableTranManagerSet) TransactionManagerFactory.getTransactionManager()).resume(_transaction);
  
                      _transaction.internalCommit();
                      _transaction.notifyCompletion();
                  } catch (HeuristicMixedException hme) {
                      // No FFDC code needed.
                      _heuristic = StatefulResource.HEURISTIC_MIXED;
                  } catch (HeuristicHazardException hme) {
                      // No FFDC code needed.
                      _heuristic = StatefulResource.HEURISTIC_HAZARD;
                  } catch (HeuristicRollbackException hre) {
                      // No FFDC code needed.
                      _heuristic = StatefulResource.HEURISTIC_ROLLBACK;
                  } catch (Throwable exc) { // javax.transaction.SystemException
                      FFDCFilter.processException(exc, "com.ibm.tx.remote.TransactionWrapper.commit", "380", this);
                      Tr.error(tc, "WTRN0068_COMMIT_FAILED", exc);
                      _transaction.notifyCompletion();
                      sysException = true;
                  }
                  break;
  
              // If the transaction that this object represents has already been completed,
              // raise a heuristic exception if necessary.  This object must wait for a
              // forget before destroying itself if it returns a heuristic exception.
  
              case TransactionState.STATE_HEURISTIC_ON_COMMIT:
              case TransactionState.STATE_COMMITTED:
                  // Return last heuristic value and allow for recovery
                  _heuristic = _transaction.getResources().getHeuristicOutcome();
                  break;
  
              case TransactionState.STATE_COMMITTING:
                  // We should only get in this state if we are in recovery and this
                  // inbound commit arrives.  In other cases, if we are committing
                  // we will hold out using the association counts and if we are
                  // locally retrying we will be in a heuristic state as we returned
                  // heuristic hazard to the superior.
  
                  ((DistributableTransaction) _transaction).removeAssociation();
                  final TRANSIENT tre = new TRANSIENT();
                  if (tc.isEntryEnabled())
                      Tr.exit(tc, "commit", tre);
                  throw tre;
  
              case TransactionState.STATE_ROLLING_BACK:
              case TransactionState.STATE_HEURISTIC_ON_ROLLBACK:
              case TransactionState.STATE_ROLLED_BACK:
                  // Admin heuristic rollback ...
                  // again retry ... respond with heurrb
                  _heuristic = StatefulResource.HEURISTIC_ROLLBACK;
                  break;
  
              case TransactionState.STATE_NONE:
                  // Transaction has completed and is now finished
                  // Normally the remoteable object would be disconnected from the orb,
                  // but ... timing may mean get got here while it was happenning
                  // We could just return ok, but it is more true to return exception
                  ((DistributableTransaction) _transaction).removeAssociation();
                  final OBJECT_NOT_EXIST one = new OBJECT_NOT_EXIST();
                  if (tc.isEntryEnabled())
                      Tr.exit(tc, "commit", one);
                  throw one;
  
              default:
                  Tr.error(tc, "WTRN0069_COMMIT_BAD_STATE", TransactionState.stateToString(state));
                  sysException = true;
                  break;
          } // end switch
  
          ((DistributableTransaction) _transaction).removeAssociation();
  
          switch (_heuristic) {
              case StatefulResource.NONE:
                  break;
  
              case StatefulResource.HEURISTIC_ROLLBACK:
  //                _transaction.addHeuristic();
                  final HeuristicRollbackException hr = new HeuristicRollbackException();
                  if (tc.isEntryEnabled())
                      Tr.exit(tc, "commit", hr);
                  throw hr;
  
              case StatefulResource.HEURISTIC_HAZARD:
  //                _transaction.addHeuristic();
                  final HeuristicHazardException hh = new HeuristicHazardException();
                  if (tc.isEntryEnabled())
                      Tr.exit(tc, "commit", hh);
                  throw hh;
  
              default:
  //                _transaction.addHeuristic();
                  final HeuristicMixedException hm = new HeuristicMixedException();
                  if (tc.isEntryEnabled())
                      Tr.exit(tc, "commit", hm);
                  throw hm;
          }
  
          if (sysException) {
              final SystemException se = new SystemException();
              if (tc.isEntryEnabled())
                  Tr.exit(tc, "commit", se);
              throw se;
          }
  
          if (tc.isEntryEnabled())
              Tr.exit(tc, "commit");
      }