Applies committed operations to the state machine.
764036
private CommitResult commitTransaction(TransactionScope<K> transactionScope) {
    TransactionLog<MapUpdate<K, byte[]>> transactionLog = transactionScope.transactionLog();
    boolean retainTombstones = !activeTransactions.isEmpty();

    List<AtomicMapEvent<K, byte[]>> eventsToPublish = Lists.newArrayList();
    for (MapUpdate<K, byte[]> record : transactionLog.records()) {
      if (record.type() == MapUpdate.Type.VERSION_MATCH) {
        continue;
      }

      K key = record.key();
      checkState(preparedKeys.remove(key), "key is not prepared");

      if (record.type() == MapUpdate.Type.LOCK) {
        continue;
      }

      MapEntryValue previousValue = entries().remove(key);

      // Cancel the previous timer if set.
      cancelTtl(previousValue);

      MapEntryValue newValue = null;

      // If the record is not a delete, create a transactional commit.
      if (record.type() != MapUpdate.Type.REMOVE_IF_VERSION_MATCH) {
        newValue = new MapEntryValue(MapEntryValue.Type.VALUE, currentVersion, record.value(), 0, 0);
      } else if (retainTombstones) {
        // For deletes, if tombstones need to be retained then create and store a tombstone commit.
        newValue = new MapEntryValue(MapEntryValue.Type.TOMBSTONE, currentVersion, null, 0, 0);
      }

      AtomicMapEvent<K, byte[]> event;
      if (newValue != null) {
        entries().put(key, newValue);
        if (!valueIsNull(newValue)) {
          if (!valueIsNull(previousValue)) {
            event = new AtomicMapEvent<>(
                AtomicMapEvent.Type.UPDATE,
                key,
                toVersioned(newValue),
                toVersioned(previousValue));
          } else {
            event = new AtomicMapEvent<>(
                AtomicMapEvent.Type.INSERT,
                key,
                toVersioned(newValue),
                null);
          }
        } else {
          event = new AtomicMapEvent<>(
              AtomicMapEvent.Type.REMOVE,
              key,
              null,
              toVersioned(previousValue));
        }
      } else {
        event = new AtomicMapEvent<>(
            AtomicMapEvent.Type.REMOVE,
            key,
            null,
            toVersioned(previousValue));
      }
      eventsToPublish.add(event);
    }
    publish(eventsToPublish);
    return CommitResult.OK;
  }
1148399
def committed!(should_run_callbacks: true) #:nodoc:
      if should_run_callbacks && trigger_transactional_callbacks?
        @_committed_already_called = true
        _run_commit_without_transaction_enrollment_callbacks
        _run_commit_callbacks
      end
    ensure
      @_committed_already_called = false
      force_clear_transaction_record_state
    end
828523
def run_to_states(self):
        
        self.execution_engine_lock.acquire()
        return_value = self._run_to_states
        self.execution_engine_lock.release()
        return return_value
594093
def commit(self):
        """"""
        if (not self._add_cache and
                not self._remove_cache and
                not self._undefined_cache):
            return

        for store_key, hash_values in self._add_cache.items():
            for hash_value in hash_values:
                super(TransactionalIndex, self).add_hashed_value(
                    hash_value, store_key)
        for store_key in self._remove_cache:
            super(TransactionalIndex, self).remove_key(store_key)
        for store_key in self._undefined_cache:
            super(TransactionalIndex, self).add_undefined(store_key)
        if not self.ephemeral:
            self.save_to_store()

        self._init_cache()
        self._in_transaction = True
852287
function StateMachine(name) {
        var _this = _super.call(this, name, undefined) || this;
        /** Internal flag: false if the state machine model requires recompilation. */
        /** @internal */ _this.clean = false;
        return _this;
    }
147250
protected function applyOperations()
    {
        if (!$this->isOperationsApplied) {
            $this->isOperationsApplied = true;
            foreach ($this->getControls() as $control) {
                $this->getDataProvider()->operations()->add($control->getOperation());
            }
        }
    }
749178
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");
    }
1142490
protected void registerAddOperation(final ManagementResourceRegistration registration, final AbstractAddStepHandler handler,
                                        OperationEntry.Flag... flags) {
        registration.registerOperationHandler(getOperationDefinition(ModelDescriptionConstants.ADD,
                new DefaultResourceAddDescriptionProvider(registration, descriptionResolver, orderedChild), OperationEntry.EntryType.PUBLIC, flags)
                , handler);
    }
398572
def execute(self):
        
        self._state_machine.transition_to_execute()
        for action in self._actions:
            self._executed_actions.append(action)
            self.execute_with_retries(action, lambda a: a.execute())
        self._state_machine.transition_to_execute_complete()
348115
void apply() {
        final FlushLog log = new FlushLog();
        store.logOperations(txn, log);
        final BlobVault blobVault = store.getBlobVault();
        if (blobVault.requiresTxn()) {
            try {
                blobVault.flushBlobs(blobStreams, blobFiles, deferredBlobsToDelete, txn);
            } catch (Exception e) {
                // out of disk space not expected there
                throw ExodusException.toEntityStoreException(e);
            }
        }
        txn.setCommitHook(new Runnable() {
            @Override
            public void run() {
                log.flushed();
                final EntityIterableCacheAdapterMutable cache = PersistentStoreTransaction.this.mutableCache;
                if (cache != null) { // mutableCache can be null if only blobs are modified
                    applyAtomicCaches(cache);
                }
            }
        });
    }
556046
synchronized void statusUpdate(float progress,
                                 String state, 
                                 Counters counters) {
    setProgress(progress);
    setStateString(state);
    setCounters(counters);
  }
1089389
public function commit()
    {
        foreach ($this->registry->all() as $entity) {
            switch($this->getEntityState($entity)) {
                case EntityStates::NEW_ENTITY:
                    $this->commandBus->dispatch(new NewCommand($entity));
                    break;
                case EntityStates::EDITED_ENTITY:
                    $changeSet = $this->changeBuilder->buildChanges($this->registry->getSnapshot($entity), $entity);
                    $this->commandBus->dispatch(new EditCommand($entity, $changeSet));
                    break;
                case EntityStates::REMOVED_ENTITY:
                    $this->commandBus->dispatch(new RemoveCommand($entity));
                    break;
            }
        }

        $this->registry->cleanRemoved();
        $this->registry->makeNewSnapshots();
    }
458267
def commit(self):
        """"""
        self.flush()
        if hasattr(self, 'transaction') and self.transaction.is_active:
            self.transaction.commit()
        elif hasattr(self, 'connection'):
            self.connection.commit()
1212689
public void commit() {
        if (isBuffering()) {
            if (logger.isDebugEnabled()) {
                logger.debug("Committing buffered value '" + getValue() + "' to wrapped value model '" + wrappedModel
                        + "'");
            }
            wrappedModel.setValueSilently(getValueToCommit(), wrappedModelChangeHandler);
            setValue(wrappedModel.getValue()); // check if the wrapped model changed the committed value
        }
        else {
            if (logger.isDebugEnabled()) {
                logger.debug("No buffered edit to commit; nothing to do...");
            }
        }
    }
192912
function() {
    var self = this;
    var fsm = self.filterStateModel;
    var filter = fsm.getActiveFilter();
    if (filter) {
      self.trigger("filter:apply", filter.cid, filter);
    }
  }
1008191
public void committed()
    {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.entry(tc, "committed");

      synchronized (_streamStatus)
      {
        _aiStream = null;
        _persistentStreamState = null;
      }

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "committed");
    }
883471
public static void commit()
   {
      try {
         if (!isDone()) {
            userTransaction.commit();
         }
         else {
            LOGGER.warn("commit() called with no current transaction.");
         }
      }
      catch (Exception e) {
         throw new RuntimeException("Transaction commit failed.", e);
      }
   }