/* (non-Javadoc)
@see javax.resource.spi.XATerminator#commit(javax.transaction.xa.Xid, boolean)
559971
public void commit(Xid xid, boolean onePhase) throws XAException
    {
        if (tc.isEntryEnabled()) Tr.entry(tc, "commit", new Object[] {xid, onePhase});

		final JCATranWrapper txWrapper;
		
		try
		{
			validateXid(xid);
			
			// Get the wrapper adding an association in the process
			txWrapper = getTxWrapper(xid, true);
		}
		catch (XAException e)
		{
			if (tc.isEntryEnabled()) Tr.exit(tc, "commit", "caught XAException: " + XAReturnCodeHelper.convertXACode(e.errorCode));
			throw e;
		}

		try
		{
			if (onePhase)
			{
				// Perform one-phase commit
				txWrapper.commitOnePhase();
			}
			else
			{
				// Perform ordinary commit (prepare has already been called)
				txWrapper.commit();
			}
		}
		catch (XAException e)
		{
			TxExecutionContextHandler.removeAssociation(txWrapper);
			
			if (tc.isEntryEnabled()) Tr.exit(tc, "commit", "rethrowing XAException: " + XAReturnCodeHelper.convertXACode(e.errorCode));
			throw e;
		}

		TxExecutionContextHandler.removeAssociation(txWrapper);

		if (tc.isEntryEnabled()) Tr.exit(tc, "commit");
    }
1128489
@Override
    public void commit()
    {
        if (!getRollbackOnly())
        {
            onTransaction(TxAction.COMMIT);
            ((EntityManagerImpl) entityManager).getPersistenceDelegator().commit();
        }
    }
791448
def commit(self, commit):
        '''
        
        '''

        c = self.commit
        if c:
            if not commit:
                commit = c[0]
            if commit in c:
                self._checkout(treeish=commit)
1015476
@Override
    public void commitChanges() throws JMSException
    {
    	try
    	{
	    	SynchronizationBarrier barrier = new SynchronizationBarrier();
	    	commitChanges(barrier);
	    	barrier.waitFor();
    	}
    	catch (InterruptedException e)
    	{
    		throw new DataStoreException("Wait for commit barrier was interrupted");
    	}
    }
1372211
public void commit(Xid xid, Object logMark) throws LogException {
        //the data is theoretically unnecessary but is included to help with debugging
        // and because HOWL currently requires it.
        byte[][] data = new byte[4][];
        data[0] = new byte[]{COMMIT};
        data[1] = intToBytes(xid.getFormatId());
        data[2] = xid.getGlobalTransactionId();
        data[3] = xid.getBranchQualifier();
        try {
            logger.putDone(data, (XACommittingTx) logMark);
        } catch (LogClosedException | LogRecordSizeException | InterruptedException | IOException | LogFileOverflowException e) {
            throw new IllegalStateException(e);
        }
    }
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();
    }
785498
public void rollback(final Xid xid) throws XAException {

        final String methodName = "rollback";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, methodName, xid);
        }

        _siXaResource.rollback(xid);

        // Add the value true to indicate we have rolled back to the hashtable of
        // stats (keying off the xid)
        synchronized (_transactionStates) {

          _transactionStates.put (xid, Boolean.TRUE);

          if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
            StringBuffer sb = new StringBuffer ("After adding the xid ");
            sb.append (xid);
            sb.append (" the hashtable of transactionStates now contains ");
            sb.append (_transactionStates.size());
            sb.append (" entries");
            SibTr.debug (this, TRACE, sb.toString());
          }

        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, methodName);
        }

    }
373565
public void runCommit(boolean forceRollback) throws HeuristicMixedException, HeuristicRollbackException, RollbackException {
      if (trace) {
         log.tracef("runCommit(forceRollback=%b) invoked in transaction with Xid=%s", forceRollback, xid);
      }
      if (forceRollback) {
         markRollbackOnly(new RollbackException(FORCE_ROLLBACK_MESSAGE));
      }

      int notifyAfterStatus = 0;

      try {
         if (status == Status.STATUS_MARKED_ROLLBACK) {
            notifyAfterStatus = Status.STATUS_ROLLEDBACK;
            rollbackResources();
         } else {
            notifyAfterStatus = Status.STATUS_COMMITTED;
            commitResources();
         }
      } finally {
         notifyAfterCompletion(notifyAfterStatus);
         DummyBaseTransactionManager.setTransaction(null);
      }
      throwRollbackExceptionIfAny(forceRollback);
   }
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);
      }
   }
502535
public function commit($xid)
    {
        if ($this->activeTransaction != $xid || $this->activeTransaction === false) {
            return;
        }

        $this->activeTransaction = false;

        if (!$this->connection->commit()) {
            throw new DbException("Commit failed");
        }
    }
585329
public void commit(Object root) {
		try {
			XChangesBatch xUpdateControl = (XChangesBatch) UnoRuntime
					.queryInterface(XChangesBatch.class, root);
			xUpdateControl.commitChanges();
		} catch (WrappedTargetException e) {
			e.printStackTrace();
		}
	}
89358
@Override
   public void commit(Xid externalXid, boolean isOnePhase) throws XAException {
      txTable.commit(externalXid, isOnePhase);
   }
1168531
void startTransactionalBranch(Xid xid) {

        cleanupTransactionBinding();

        final TransactionBindingType transactionBindingType = this.transactionBinding.getTransactionBindingType();

        // already associated to a local transaction
        if (transactionBindingType == TransactionBindingType.LocalTransaction) {
            LocalTransactionProxy<C> localTransactionProxy = this.toLocalTransaction();
            Validate.isTrue(!localTransactionProxy.hasTransactionalData(),
                    "Connection is associated to a local transaction and has uncommitted transactional data");
            if (localTransactionProxy.hasTransactionalData()) {
                throw new IllegalStateException(
                        "Connection is associated to a local transaction and has uncommitted transactional data");
            }

            XATransactionalBranch<C> xaTransactionalBranch = 
                    this.xaTransactionalBranchDictionary.findTransactionalBranch(xid);
            // xaTransactionalBranch!=null => joining a existing transactional branch
            if (xaTransactionalBranch == null) {
                IPhynixxManagedConnection<C> connection = localTransactionProxy.getConnection();
                if( connection==null || connection.isClosed()) {
                    connection= this.createPhysicalConnection();
                }
                xaTransactionalBranch = this.xaTransactionalBranchDictionary.instanciateTransactionalBranch(xid, connection);
            } else {
                localTransactionProxy.close();
            }
            // forget the Local transaction
            this.transactionBinding.release();

            XATransactionalBranch<C> transactionalBranch = this.xaTransactionalBranchDictionary
                    .findTransactionalBranch(xid);
            Validate.isTrue(xaTransactionalBranch != null, "Expect a transactional branch to be created");

            this.transactionBinding.activateGlobalTransaction(new GlobalTransactionProxy<C>(transactionalBranch));

            // no transaction binding
        } else if (transactionBindingType == TransactionBindingType.NoTransaction) {
            XATransactionalBranch<C> transactionalBranch = this.xaTransactionalBranchDictionary
                    .findTransactionalBranch(xid);

            // / xaTransactionalBranch!=null => joining a existing transactional
            // branch
            if (transactionalBranch == null) {
                IPhynixxManagedConnection<C> physicalConnection = this.createPhysicalConnection();
                transactionalBranch = this.xaTransactionalBranchDictionary.instanciateTransactionalBranch(xid,
                        physicalConnection);
                this.xaTransactionalBranchDictionary.instanciateTransactionalBranch(xid, physicalConnection);
            }
            this.transactionBinding.activateGlobalTransaction(new GlobalTransactionProxy<C>(transactionalBranch));

            // if bound to a global TX , check if same XID
        } else if (transactionBindingType == TransactionBindingType.GlobalTransaction) {

            XATransactionalBranch<C> transactionalBranch = this.xaTransactionalBranchDictionary
                    .findTransactionalBranch(xid);

            // xaTransactionalBranch!=null => joining a existing transactional
            // branch
            if (transactionalBranch == null) {
                IPhynixxManagedConnection<C> physicalConnection = this.createPhysicalConnection();
                transactionalBranch = this.xaTransactionalBranchDictionary.instanciateTransactionalBranch(xid,
                        physicalConnection);
                this.xaTransactionalBranchDictionary.instanciateTransactionalBranch(xid, physicalConnection);
            }

            // Check if previous XID are compatible to the current
            GlobalTransactionProxy<C> previousGlobalTransactionProxy = this.transactionBinding
                    .getEnlistedGlobalTransaction();
            if (previousGlobalTransactionProxy != null) {
                Xid previousXid = previousGlobalTransactionProxy.getXid();
                byte[] currentTransactionId = previousXid.getGlobalTransactionId();
                if (!Arrays.equals(xid.getGlobalTransactionId(), currentTransactionId)) {
                    LOG.warn("TransactionId of the new Transaction doenn't corresponds to the transactionId of the previous Ids");
                }
                previousGlobalTransactionProxy.release();
            }

            this.transactionBinding.activateGlobalTransaction(new GlobalTransactionProxy<C>(transactionalBranch));

        }

    }
253175
public synchronized void putXid(Xid xid)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "putXid", xid);

      putInt(xid.getFormatId());
      putInt(xid.getGlobalTransactionId().length);
      put(xid.getGlobalTransactionId());
      putInt(xid.getBranchQualifier().length);
      put(xid.getBranchQualifier());

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "putXid");
   }
892200
public void commit() {
        Log.info("Committing");
        try {
            indexWriter.commit();
        } catch (IOException e) {
            Log.error(e, "Error while committing");
            throw new RuntimeException(e);
        }
    }
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");
   }
886593
public final void commitExternal(final PersistentTransaction transaction)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        {
            SibTr.entry(this, tc, "commitExternal", transaction);
            SibTr.exit(this, tc, "commitExternal");
        }
    }