--- transactional methods ---
763190
public <R> R withCommitTransaction(TransFunc<R> transFunc) throws IOException {
    return withTransaction(transFunc, true);
  }
1054569
@Override
    public CompletableFuture<Void> completeCommittingTransactions(VersionedMetadata<CommittingTransactionsRecord> record) {
        // create all transaction entries in committing txn list. 
        // remove all entries from active txn in epoch. 
        // reset CommittingTxnRecord
        long time = System.currentTimeMillis();

        Map<String, byte[]> completedRecords = record.getObject().getTransactionsToCommit().stream()
                                                               .collect(Collectors.toMap(UUID::toString, 
                                                                       x -> new CompletedTxnRecord(time, TxnStatus.COMMITTED).toBytes()));
        CompletableFuture<Void> future;
        if (record.getObject().getTransactionsToCommit().size() == 0) {
            future = CompletableFuture.completedFuture(null);
        } else {
            future = createCompletedTxEntries(completedRecords)
                    .thenCompose(x -> getTransactionsInEpochTable(record.getObject().getEpoch())
                            .thenCompose(table -> storeHelper.removeEntries(table, completedRecords.keySet())))
                    .thenCompose(x -> tryRemoveOlderTransactionsInEpochTables(epoch -> epoch < record.getObject().getEpoch()));
        }
        return future
                .thenCompose(x -> Futures.toVoid(updateCommittingTxnRecord(new VersionedMetadata<>(CommittingTransactionsRecord.EMPTY,
                        record.getVersion()))));
    }
1334652
@Override
	public void commit() {
		Optional<LocalTransactionContext> txContext = currentTxContext();
		if (txContext.isPresent()) {
			txContext.get().commit();
		} else {
			this.unmanagedTransaction.ifPresent(LocalTransactionContext::commit);
		}
	}
847885
private void applyUpdates(DBTransaction transaction) {
        if (transaction.getMutationsCount() == 0) {
            m_logger.debug("Skipping commit with no updates");
        } else if (m_dbservice.getParamBoolean("async_updates")) {
            executeUpdatesAsynchronous(transaction);
        } else {
            executeUpdatesSynchronous(transaction);
        }
    }
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);
	}
978387
public void execute(TransactionCommon t) throws Throwable
    {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.entry(tc, "execute", t);

      _aiStream.removeCompletedPrefix(
        t,
        _messageProcessor.getMessageStore().getUniqueLockID(AbstractItem.STORE_NEVER));
      synchronized (_persistentStreamState)
      {
        if (_streamStateRemoveNeedsToWait)
        {
          _persistentStreamState.wait();
        }

        long lockID = _messageProcessor.getMessageStore().getUniqueLockID(AbstractItem.STORE_NEVER);
        _persistentStreamState.lockItemIfAvailable(lockID);
        Transaction msTran = _messageProcessor.resolveAndEnlistMsgStoreTransaction(t);
        _persistentStreamState.remove(msTran, lockID);
      }

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "execute");
    }
435442
public final void persist(BatchingContext batchingContext, TransactionState tranState)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "persist", new Object[] { batchingContext, tranState});

        if ((tranState == TransactionState.STATE_COMMITTED)
            || (tranState == TransactionState.STATE_COMMITTING_1PC)
            || (tranState == TransactionState.STATE_PREPARING)
            || (tranState == TransactionState.STATE_PREPARED))
        {
            batchingContext.insert(getPersistable());
        }
        else if ((tranState == TransactionState.STATE_ROLLEDBACK)
                 || (tranState == TransactionState.STATE_ROLLINGBACK))
        {
            batchingContext.delete(getPersistable());
        }
        else if (tranState == TransactionState.STATE_COMMITTING_2PC)
        {
            //Do nothing.
        }
        else
        {
            throw new IllegalStateException(nls.getFormattedMessage("INVALID_TASK_OPERATION_SIMS1520", new Object[] {tranState}, null));
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "persist");
    }
1206135
@Override
	public void onTxCommit(Transaction tx) {
		if (!tx.isReadOnly() && enableLogging) {
			LogSeqNum lsn = new CommitRecord(txNum).writeToLog();
			VanillaDb.logMgr().flush(lsn);
		}
	}
906083
private void mergeInTransaction(EntityManager em, Collection objects) {
        EntityTransaction tx = null;
        try {
            tx = em.getTransaction();
            tx.begin();
            for (Object o : objects) {
                em.merge(o);
            }
            tx.commit();
        }
        catch (RuntimeException e) {
            if (tx != null && tx.isActive()) {
                tx.rollback();
            }
            throw e;
        }
    }
1095711
public function commitTransaction()
    {
        if (!self::$transaction) {
            throw new TransactionException("There is no Active Transaction");
        }

        self::$transaction = false;
        foreach (self::$connectionList as $dbDriver) {
            $dbDriver->commitTransaction();
        }
    }
93234
public void associateServerTransaction(ClientTransaction ct, ServerTransaction st) {
		if (ct == null) {
			throw new NullPointerException("null client transaction");
		}		
		if (st == null) {
			throw new NullPointerException("null server transaction");
		}
		final ClientTransactionWrapper ctw = (ClientTransactionWrapper) ct;
		final ServerTransactionWrapper stw = (ServerTransactionWrapper) st;
		
		final DialogWrapper stDialog = (DialogWrapper) st.getDialog();
		if (stDialog == null) {
			throw new IllegalArgumentException("the specified server transaction has no dialog.");
		}
		
		ctw.setAssociatedServerTransaction(((ServerTransactionActivityHandle) stw.getActivityHandle()).getTxId(),true);
	}
13413
private void executeUpdatesAsynchronous(DBTransaction transaction) {
        Collection<BoundStatement> mutations = getMutations(transaction);
        List<ResultSetFuture> futureList = new ArrayList<>(mutations.size());
        for(BoundStatement mutation: mutations) {
            ResultSetFuture future = m_dbservice.getSession().executeAsync(mutation);
            futureList.add(future);
        }
        m_logger.debug("Waiting for {} asynchronous futures", futureList.size());
        for (ResultSetFuture future : futureList) {
            future.getUninterruptibly();
        }
    }
20031
@Override
	public void onTxRollback(Transaction tx) {
		if (!tx.isReadOnly() && enableLogging) {
			rollback(tx);
			LogSeqNum lsn = new RollbackRecord(txNum).writeToLog();
			VanillaDb.logMgr().flush(lsn);
		}
	}
489820
public void commit(boolean force) {
        if (checkSession()) {
            return;
        }

        if (log.isDebugEnabled()) {
            ToStringBuilder tsb = new ToStringBuilder(String.format("Committing transactional %s@%x",
                    sqlSession.getClass().getSimpleName(),sqlSession.hashCode()));
            tsb.append("force", force);
            log.debug(tsb.toString());
        }

        sqlSession.commit(force);
    }
785482
private void add(SessionImpl session, PlainChangesLog changes) throws SystemException, IllegalStateException,
      RollbackException
   {
      Transaction tx = tm.getTransaction();
      if (tx == null)
      {
         // No active tx so there is no need to register the session
         return;
      }
      // Get the current TransactionContext
      TransactionContext ctx = getOrCreateTransactionContext();
      // Register the tx if it has not been done already
      ctx.registerTransaction(tx);
      // Register the given changes
      ctx.add(session, changes);
   }
877302
def Transactional(fn, self, *argv, **argd):
    
    return self._transactional(fn, *argv, **argd)
54443
public void beginTransaction() throws HibernateException
    {
        Transaction tx = threadTransaction.get();
        if (tx == null)
        {
            tx = getSession().beginTransaction();
            threadTransaction.set(tx);
        }
    }