/*
(non-Javadoc)
@see org.springframework.transaction.PlatformTransactionManager#commit(org.springframework.transaction.TransactionStatus)
169847
public void commit(TransactionStatus status) throws TransactionException {

		MultiTransactionStatus multiTransactionStatus = (MultiTransactionStatus) status;

		boolean commit = true;
		Exception commitException = null;
		PlatformTransactionManager commitExceptionTransactionManager = null;

		for (PlatformTransactionManager transactionManager : reverse(transactionManagers)) {

			if (commit) {

				try {
					multiTransactionStatus.commit(transactionManager);
				} catch (Exception ex) {
					commit = false;
					commitException = ex;
					commitExceptionTransactionManager = transactionManager;
				}

			} else {

				// after unsucessfull commit we must try to rollback remaining transaction managers

				try {
					multiTransactionStatus.rollback(transactionManager);
				} catch (Exception ex) {
					LOGGER.warn("Rollback exception (after commit) (" + transactionManager + ") " + ex.getMessage(), ex);
				}
			}
		}

		if (multiTransactionStatus.isNewSynchronization()) {
			synchronizationManager.clearSynchronization();
		}

		if (commitException != null) {
			boolean firstTransactionManagerFailed = commitExceptionTransactionManager == getLastTransactionManager();
			int transactionState = firstTransactionManagerFailed ? HeuristicCompletionException.STATE_ROLLED_BACK
					: HeuristicCompletionException.STATE_MIXED;
			throw new HeuristicCompletionException(transactionState, commitException);
		}
	}
785290
@Override
    public void commitChanges(SynchronizationBarrier barrier) throws JMSException
    {
    	checkNotClosed();
    	checkTransactionLock();
    	
    	if (!committables.isEmpty())
        {
    		long start = System.currentTimeMillis();
    		
    		Iterator<Committable> allCommitables = committables.iterator();
        	while (allCommitables.hasNext())
        	{
        		Committable committable = allCommitables.next();
        		committable.commitChanges(barrier);
        	}
        	
        	long end = System.currentTimeMillis();
        	notifyCommitTime(end-start);
        	
        	pendingChanges = false;
        }
    }
277100
public final void commitExternal(final PersistentTransaction transaction) throws SevereMessageStoreException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "commitExternal", transaction);

        // I did not expect that - the xaCommit for all Add task
        // must be called *after* all internalCommitAdd() calls
        // on the same transaction.  So we move the xaCommit call
        // to the 'external' commit phase.
        getLink().commitAdd(transaction);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "commitExternal");
    }
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;
    	}
    }
32001
@Override
    public void commit() throws SQLException
    {
        checkClosed();
        if (props.getProperty(COMMIT_THROW_EXCEPTION, "true").equalsIgnoreCase("true")) {
            throw SQLError.noSupport();
        }
    }
1184445
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");
    }
753237
@Override
    public void commit(DBTransaction dbTran) {
        assert dbTran.getTenant().getName().equals(this.getTenant().getName());
        DBConn dbConn = getDBConnection();
        try {
            dbConn.commit(dbTran);
        } finally {
            returnDBConnection(dbConn);
        }
    }
36414
public void commitTransaction() throws HibernateException
    {
        Transaction tx = threadTransaction.get();
        threadTransaction.set(null);
        if (tx != null && !tx.wasCommitted() && !tx.wasRolledBack())
        {
            tx.commit();
        }
    }
255234
@Override
  public void commit() throws IOException {
    try {
      LOG.info("Flushing pending insert.");
      this.commands.flush();
      LOG.info("Commiting transaction.");
      this.conn.commit();
    } catch (Exception e) {
      this.failed = true;
      throw new RuntimeException(e);
    }
  }
748925
def commit(self, callback=None):
        ''''''
        if self.executed:
            raise InvalidTransaction('Invalid operation. '
                                     'Transaction already executed.')
        session = self.session
        self.session = None
        self.on_result = self._commit(session, callback)
        return self.on_result
667274
@Override
    public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException,
            SecurityException, IllegalStateException, SystemException
    {
        Transaction tx = threadLocal.get();

        try
        {
            if (tx != null)
            {
                if (log.isDebugEnabled())
                    log.info("Commiting transaction:" + tx);
                tx.commit();
            }
            else
            {
                log.debug("Cannot locate a transaction to commit.");

            }
        }
        finally
        {
            if (log.isDebugEnabled())
                log.info("Resetting after commit.");
            threadLocal.set(null);
            timerThead.set(null);
        }
    }
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);
      }
   }
1101633
@Override
	public void commit() {
		List<Key> deletes = new ArrayList<Key>();
		deletes.add(Translation.toEntity(lock, Keys.create(
				Translation.toKind(entity.getClass()), 
				Entities.keyValue(entity))).getKey());
		Key transactionKey = KeyFactory.stringToKey(lock.transaction());
		
		if (Keys.ancestor(transactionKey).equals(
				Keys.create(Translation.toKind(entity.getClass()), Entities.keyValue(entity)))) {
			deletes.add(transactionKey);
			
			for (Entity entity : datastore.query(
					new Query(transactionKey).setKeysOnly())) {
				deletes.add(entity.getKey());
			}
		}
		
		Key parent = Keys.create(Translation.toKind(entity.getClass()), Entities.keyValue(entity));
		apply(operation, entity, Translation.toEntity(lock, parent).getKey(), deletes);
	}
20181
protected function commit_transaction() {
        $this->query_start('--oracle_commit', NULL, SQL_QUERY_AUX);
        $result = oci_commit($this->oci);
        $this->commit_status = OCI_COMMIT_ON_SUCCESS;
        $this->query_end($result);
    }
1170934
void preCommit(Transaction transaction)
                    throws ObjectManagerException
    {
        throw new InvalidStateException(this, InternalTransaction.stateTerminated, InternalTransaction.stateNames[InternalTransaction.stateTerminated]);
    }
580707
public void commit(DBTransaction dbTran) {
        try {
            applyUpdates(dbTran);
        } catch (Exception e) {
            // All retries, if needed, failed.
            m_logger.error("Commit failed", e);
            throw e;
        } finally {
            dbTran.clear();
        }
    }
205415
public synchronized void commit()
      throws SIIncorrectCallException, 
             SIRollbackException,
             SIResourceException,
             SIConnectionLostException, 
             SIErrorException
   {
      if (tc.isEntryEnabled()) SibTr.entry(this, tc, "commit");
      
      if (!valid) 
      {
         throw new SIIncorrectCallException(
            nls.getFormattedMessage("TRANSACTION_COMPLETE_SICO1022", null, null)
         );
      }
      
      // Mark this as invalid
      valid = false;
      
      CommsByteBuffer request = getCommsByteBuffer();
      request.putShort(getConnectionObjectID());
      request.putInt(getTransactionId());

      CommsByteBuffer reply = null;
      try
      {
         // Pass on call to server
         reply = jfapExchange(request,
                              JFapChannelConstants.SEG_COMMIT_TRANSACTION,
                              lowestPriority,
                              true);

         short err = reply.getCommandCompletionCode(JFapChannelConstants.SEG_COMMIT_TRANSACTION_R);
         if (err != CommsConstants.SI_NO_EXCEPTION)
         {
            checkFor_SIIncorrectCallException(reply, err);
            checkFor_SIRollbackException(reply, err);
            checkFor_SIResourceException(reply, err);
            checkFor_SIConnectionLostException(reply, err);
            checkFor_SIErrorException(reply, err);
            defaultChecker(reply, err);
         }
      }
      catch (SIConnectionDroppedException e)
      {
         // No FFDC Code needed
         // In this case we translate this to an SIConnectionLostException - as transactions aren't
         // tided to a particular connection
         throw new SIConnectionLostException(e.getMessage(), e);
      }
      finally
      {
         if (reply != null) reply.release();
      }
      
      if (tc.isEntryEnabled()) SibTr.exit(this, tc, "commit");
   }