/*
Commit the transaction that is currently in effect for this session.
Note, if there is no transaction (e.g. in auto ack mode), an exception
will be thrown.

@see javax.jms.JMSContext#commit()
558532
@Override
    public void commit() throws IllegalStateRuntimeException, TransactionRolledBackRuntimeException, JMSRuntimeException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "commit");

        try {
            jmsSession.commit();
        } catch (IllegalStateException ise) {
            throw (IllegalStateRuntimeException) JmsErrorUtils.getJMS2Exception(ise, IllegalStateRuntimeException.class);
        } catch (TransactionRolledBackException trbe) {
            throw (TransactionRolledBackRuntimeException) JmsErrorUtils.getJMS2Exception(trbe, TransactionRolledBackRuntimeException.class);
        } catch (JMSException jmse) {
            throw (JMSRuntimeException) JmsErrorUtils.getJMS2Exception(jmse, JMSRuntimeException.class);
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "commit");
        }

    }
702862
@Override
    public void commit() throws RollbackException, HeuristicMixedException, HeuristicRollbackException,
            SecurityException, IllegalStateException, SystemException
    {
        if (!setRollBackOnly)
        {
            for (ResourceManager implementor : implementors)
            {
                if (implementor != null)
                {
                    implementor.doCommit();
                }
            }
            status = Status.STATUS_COMMITTED;
        }
        else
        {
            if (log.isDebugEnabled())
                log.debug("Transaction is set for rollback only, processing rollback.");

            for (ResourceManager implementor : implementors)
            {
                if (implementor != null)
                {
                    implementor.doRollback();
                    status = Status.STATUS_ROLLEDBACK;
                }
            }
        }

    }
221085
public void commit() {
        if (isCommitted()) {
            return;
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Committing: " + this);
        }
        if (null == this.response.getHeader("Content-Language")) {
            // content-language not yet set, add now
            this.response.setHeader(
                                    "Content-Language",
                                    getLocale().toString().replace('_', '-'));
        }
        if (null != this.response.getHeader("Content-Encoding")) {
            this.response.removeHeader("Content-Length");
        }
        // if a session exists, store the set-cookie in the response now
        SessionInfo info = this.request.getSessionInfo();
        if (null != info) {
            SessionConfig config = info.getSessionConfig();
            if (config.usingCookies() && null != info.getSession()) {
                // create a session cookie now
                boolean add = true;
                HttpCookie existing = this.response.getCookie(config.getIDName());
                if (null != existing) {
                    if (!info.getSession().getId().equals(existing.getValue())) {
                        // some other session cookie existed but doesn't match
                        // the current session, remove it
                        this.response.removeCookie(existing);
                    } else {
                        // this session already exists
                        add = false;
                    }
                }
                if (add) {
                    this.response.addCookie(
                                    convertCookie(SessionInfo.encodeCookie(info)));
                }
            }
        } // end-if-request-session-exists
    }
623405
public void commit() throws IOException {
        if(!marked)     throw new IllegalStateException();
        marked = false;
        super.append(buffer);
        buffer.setLength(0);
    }
658914
public void commitThis(boolean onePhase) throws XAException {

        if (onePhase && state == XA_STATE_PREPARED) {
            throw new XAException(
                "Transaction is in a 2-phase state when 1-phase is requested");
        }

        if ((!onePhase) && state != XA_STATE_PREPARED) {
            throw new XAException("Attempt to do a 2-phase commit when "
                                  + "transaction is not prepared");
        }

        //if (!onePhase) {
        //  throw new XAException(
        //   "Sorry.  HSQLDB has not implemented 2-phase commits yet");
        //}
        try {

            /**
             * @todo:  Determine if work was committed, rolled back, or both,
             * and return appropriate Heuristic*Exception.
             * connection.commit();
             *  Commits the real, physical conn.
             */
            connection.commit();
        } catch (SQLException se) {
            throw new XAException(se.getMessage());
        }

        dispose();
    }
330803
public void commit() {
		for (TransactionLifecycleListener l : lifecycleListeners)
			l.onTxCommit(this);

		if (logger.isLoggable(Level.FINE))
			logger.fine("transaction " + txNum + " committed");
	}
856421
void commit(boolean onePhase) throws XAException {
		if (this.getProgressState() == XAResourceProgressState.COMMITTED) {
			return;
		}

		if (this.hasHeuristicOutcome()) {
			throw new XAException(this.heuristicState);
		}
		if (!checkTXRequirements()) {
			throw new SampleTransactionalException("State not transactional "
					+ this);
		}

		this.checkRollback();

		if (this.getProgressState() != XAResourceProgressState.ACTIVE
				&& onePhase) {
			throw new XAException(XAException.XAER_RMFAIL);
		} else if (this.getProgressState() != XAResourceProgressState.PREPARED
				&& !onePhase) {
			throw new XAException(XAException.XAER_RMFAIL);
		} else if (this.getProgressState() != XAResourceProgressState.PREPARED
				&& this.getProgressState() != XAResourceProgressState.ACTIVE) {
			throw new XAException(XAException.XAER_RMFAIL);
		}

		this.setProgressState(XAResourceProgressState.COMMITTING);
		try {
			this.getManagedConnection().commit(onePhase);
		} catch (Exception e) {
			throwXAException(XAException.XAER_PROTO, e);
		}

		this.setProgressState(XAResourceProgressState.COMMITTED);

	}
869622
def commit(self, session=None):
        
        if self.__cleared:
            return

        if self._parent:
            # nested transaction
            self._commit_parent()
        else:
            self._commit_repository()
        self._clear()
186992
public void addCommitAction(final Runnable action) throws HibernateException
	{
		if (action == null)
			return; // ignore null actions

		addAction(new BaseSessionEventListener()
		{
			@Override
			public void transactionCompletion(final boolean successful)
			{
				if (successful)
					action.run();
			}
		});
	}
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...");
            }
        }
    }
36414
public void commitTransaction() throws HibernateException
    {
        Transaction tx = threadTransaction.get();
        threadTransaction.set(null);
        if (tx != null && !tx.wasCommitted() && !tx.wasRolledBack())
        {
            tx.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());
        }
    }
778290
public function commit() {
		if ($this->transactionManager === null) {
			$this->prepareCommit();
			$this->performCommit();
		}
		
		if ($this->transactionManager->hasOpenTransaction()) {
			$this->transactionManager->getRootTransaction()->commit();
		}
	}
98061
public void commit() throws DBException
    {
        if (DBConstants.FALSE.equalsIgnoreCase(this.getProperty(SQLParams.AUTO_COMMIT_PARAM)))
        {
            if (!(this.getDatabaseOwner() instanceof RecordOwner))
                throw new DatabaseException("Transactions requires DB RecordOwnership");
        }
        else
            throw new DatabaseException("Auto-commit enabled");
    }
1092986
private void commit(boolean force) {
		if (_db == null) {
			return;
		}
		
		if (_transaction && !force) {
			return;
		}
		
		try {
			_db.commit();
		} catch (Exception e) {
			throw new IllegalStateException("Could not commit transaction", e);
		}
	}
286088
def commit(self):
		
		try:
			if self.connection is not None:
				self.connection.commit()
				self._updateCheckTime()
				self.release()
		except Exception, e:
			pass
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);
      }
   }