code: private void updateHeuristicState(boolean commit) throws SystemException {
          if (tc.isEntryEnabled())
              Tr.entry(tc, "updateHeuristicState", commit);
  
          if (_transaction.isSubordinate()) {
              // Get the current transaction state.  Need to do this in case we are
              // in recovery and have already logged a heuristic
              final TransactionState ts = _transaction.getTransactionState();
              final int state = ts.getState();
              if (commit) {
                  if (state != TransactionState.STATE_HEURISTIC_ON_COMMIT)
                      ts.setState(TransactionState.STATE_HEURISTIC_ON_COMMIT);
              } else {
                  // if state is ACTIVE, then this is called via
                  // rollbackResources, so do not change state
                  if (state != TransactionState.STATE_HEURISTIC_ON_ROLLBACK
                      && state != TransactionState.STATE_ACTIVE)
                      ts.setState(TransactionState.STATE_HEURISTIC_ON_ROLLBACK);
              }
          }
  
          if (tc.isEntryEnabled())
              Tr.exit(tc, "updateHeuristicState");
      }
docs: Possibly update the heuristic state of the transaction.
  This is only required if this is a subordinate.
  If we are a subordinate we need to update the state and log it for recovery.
  
  @param commit - true if requested to commit, else false