/*
(non-Javadoc)
@see net.timewalker.ffmq4.utils.Committable#commitChanges(net.timewalker.ffmq4.utils.concurrent.SynchronizationBarrier)
492412
@Override
	public void commitChanges( SynchronizationBarrier barrier ) throws JMSException
    {
    	checkNotClosed();
    	checkTransactionLock();
    	
    	if (persistentStore != null)
    	{
    		long start = System.currentTimeMillis();
    		synchronized (storeLock)
			{
    			persistentStore.commitChanges(barrier);
			}
    		long end = System.currentTimeMillis();
    		notifyCommitTime(end-start);

    		// Clear pending commit flag
    		pendingChanges = false;
    	}
    }
340389
@Override
	public void commitChanges() throws DataStoreException
    {
    	try
    	{
	    	SynchronizationBarrier barrier = new SynchronizationBarrier();
	    	journal.commit(barrier);
	    	barrier.waitFor();
    	}
    	catch (InterruptedException e)
    	{
    		throw new DataStoreException("Wait for commit barrier was interrupted");
    	}
    }
229809
public final void commit() {
        if (indexQueue == null) {
            luceneIndex.commit();
        } else {
            indexQueue.submitSynchronous(new Runnable() {
                @Override
                public void run() {
                    luceneIndex.commit();
                }
            });
        }
    }
46362
@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));
    }
225401
public synchronized void registerUpdater(final Updater updater) {
    if (!updaters.containsKey(updater)) {
      updaters.put(updater, Boolean.TRUE);
    }
  }
1103713
public static final void commit(final Connection connection) {
        if (connection == null) {
            return;
        }

        try {
            connection.commit();
        } catch (Exception e) {
            if (LOG.isWarnEnabled()) LOG.warn("Error committing Connection: " + connection, e);
        }
    }
1061643
@Override
    public void sync(
            final ObjectClass objClass,
            final SyncToken token,
            final SyncResultsHandler handler,
            final OperationOptions options) {

        // check objectclass
        if (objClass == null || (!objClass.equals(ObjectClass.ACCOUNT))) {
            throw new IllegalArgumentException("Invalid objectclass");
        }

        // check objectclass
        if (handler == null) {
            throw new IllegalArgumentException("Invalid handler");
        }

        // get web service client
        final Provisioning provisioning = connection.getProvisioning();
        if (provisioning == null) {
            throw new IllegalStateException("Web Service client not found");
        }

        try {
            final List<WSChange> changes = provisioning.sync();

            SyncDeltaBuilder sdb = null;

            boolean handle = true;
            for (final Iterator<WSChange> i = changes.iterator(); i.hasNext() && handle;) {
                final WSChange change = i.next();

                if (LOG.isOk()) {
                    LOG.ok("Found change {0}", change);
                }

                try {
                    sdb = buildSyncDelta(change);
                    handle = handler.handle(sdb.build());
                } catch (Exception e) {
                    LOG.error(e, "Error building connector object for change {0}", change);
                }
            }
        } catch (ProvisioningException e) {
            LOG.error("Synchronization failed");

            throw new IllegalStateException(e);
        }
    }
1206496
@Override
    public void actionCommit() {

        List<Throwable> errors = new ArrayList<Throwable>();

        try {
            // set the synchronize settings
            CmsUserSettings userSettings = new CmsUserSettings(getCms());
            m_synchronizeSettings.checkValues(getCms());
            userSettings.setSynchronizeSettings(m_synchronizeSettings);
            userSettings.save(getCms());
            setDialogObject(null);
        } catch (Throwable t) {
            errors.add(t);
        }

        // set the list of errors to display when saving failed
        setCommitErrors(errors);
    }
1359087
private void addCommitDateInstantColumnIfNeeded() {
        if (!columnExists(getCommitTableNameWithSchema(), COMMIT_COMMIT_DATE_INSTANT)){
            addStringColumn(getCommitTableNameWithSchema(), COMMIT_COMMIT_DATE_INSTANT, 30);
        } else {
            extendStringColumnIfNeeded(getCommitTableNameWithSchema(), COMMIT_COMMIT_DATE_INSTANT, 30);
        }
    }
892200
public void commit() {
        Log.info("Committing");
        try {
            indexWriter.commit();
        } catch (IOException e) {
            Log.error(e, "Error while committing");
            throw new RuntimeException(e);
        }
    }
831567
@Override
    public void changed(@NonNull DatabaseChange change) {
        synchronized (lock) {
            if (willUpdate) {
                return; // Already a pending update scheduled
            }

            if (!observing) { return; }

            // Schedule an update, respecting the updateInterval:
            long updateDelay = lastUpdatedAt + DEFAULT_LIVE_QUERY_UPDATE_INTERVAL - System.currentTimeMillis();
            updateDelay = Math.max(0, Math.min(DEFAULT_LIVE_QUERY_UPDATE_INTERVAL, updateDelay));
            update(updateDelay);
        }
    }
201761
private void dispatchCommitActions(List<CommitTaskAction> commitActions)
      throws IOException {
    if (!commitActions.isEmpty()) {
      TaskAttemptID[] wasCommitting;
      try {
        wasCommitting = commitPermissionClient
            .getAndSetCommitting(commitActions);
      } catch (IOException e) {
        LOG.error("Commit permission client is faulty - killing this JT");
        try {
          close(false);
        } catch (InterruptedException e1) {
          throw new IOException(e1);
        }
        throw e;
      }
      int i = 0;
      for (CommitTaskAction action : commitActions) {
        TaskAttemptID oldCommitting = wasCommitting[i];
        if (oldCommitting != null) {
          // Fail old committing task attempt
          failTask(oldCommitting, "Unknown committing attempt", false);
        }
        // Commit new task
        TaskAttemptID newToCommit = action.getTaskID();
        if (!newToCommit.equals(oldCommitting)) {
          String trackerName = taskLookupTable.getAssignedTracker(newToCommit);
          taskLauncher.commitTask(trackerName,
              resourceTracker.getTrackerAddr(trackerName), action);
        } else {
          LOG.warn("Repeated try to commit same attempt id. Ignoring");
        }
        // iterator next
        ++i;
      }
    }
  }
869292
@Override
    public void changed(ChangeEvent event) {
        // forget cached IDs (Should be executed in workExecutor)
        final long lastSeqPushed = (isPull() || replicationInternal.lastSequence == null) ? -1L :
                Long.valueOf(replicationInternal.lastSequence);
        if (lastSeqPushed >= 0 && lastSeqPushed != _lastSequencePushed) {
            db.runAsync(new AsyncTask() {
                @Override
                public void run(Database database) {
                    synchronized (_lockPendingDocIDs) {
                        _lastSequencePushed = lastSeqPushed;
                        _pendingDocIDs = null;
                    }
                }
            });
        }

        for (ChangeListener changeListener : changeListeners) {
            try {
                changeListener.changed(event);
            } catch (Exception e) {
                Log.e(Log.TAG_SYNC, "Exception calling changeListener.changed", e);
            }
        }
    }
392953
public final void commitPersistUnlock(PersistentTransaction transaction) throws SevereMessageStoreException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "commitPersistUnlock", transaction);

        AbstractItem item = null;
        boolean hasBecomeAvailable = false;
        boolean linkHasBecomeReleasable = false;
        synchronized (this)
        {
            if (ItemLinkState.STATE_UNLOCKING_PERSISTENTLY_LOCKED == _itemLinkState)
            {
                _assertCorrectTransaction(transaction);

                item = getItem();

                ListStatistics stats = getParentStatistics();
                synchronized (stats)
                {
                    stats.decrementLocked();
                    stats.incrementAvailable();
                }

                // Save the item before we change the state
                _lockID = NO_LOCK_ID;
                _unlockCount++;
                linkHasBecomeReleasable = _declareDiscardable();
                _itemLinkState = ItemLinkState.STATE_AVAILABLE;
                hasBecomeAvailable = true;
            }
            else
            {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled())
                    SibTr.event(this, tc, "Invalid Item state: " + _itemLinkState);
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                    SibTr.exit(this, tc, "commitPersistUnlock");
                throw new StateException(_itemLinkState.toString());
            }
            _transactionId = null;
        }
        // this stuff has to be done outside the synchronized block
        if (linkHasBecomeReleasable)
        {
            _declareReleasable(item);
        }

        // PK37596
        // Now we have completed an unlock we have become available again
        // and so need to inform our containing list in case we need to
        // be added to a cursors jumpback list.
        if (hasBecomeAvailable)
        {
            // all items are discardable in avaialable state.
            if (_owningStreamLink != null)
            {
                _owningStreamLink.linkAvailable(this);
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "commitPersistUnlock");
    }
949970
final public function commitChanges()
    {
        if (null !== $this->changes) {
            $this->lastCommittedEventSequenceNumber = $this->changes->lastSequenceNumber();
            $this->changes->commit();
        }
    }
293295
@Override
    public void commit()
        throws HeuristicMixedException,
               HeuristicRollbackException,
               RollbackException,
               SystemException
    {
        try {
            if (!Context.isTMNoTransaction()) {
                if (Context.isTMActive()) {
                    Context.commit();
                } else {
                    Context.rollback();
                }
            }
        } catch (final EFapsException e) {
            throw new SystemException(e.getMessage());
        }
    }
36414
public void commitTransaction() throws HibernateException
    {
        Transaction tx = threadTransaction.get();
        threadTransaction.set(null);
        if (tx != null && !tx.wasCommitted() && !tx.wasRolledBack())
        {
            tx.commit();
        }
    }