sets ISOLATION for the next transaction only
326575
public void setIsolation(int level) {

        if (isInMidTransaction()) {
            throw Error.error(ErrorCode.X_25001);
        }

        if (level == SessionInterface.TX_READ_UNCOMMITTED) {
            isReadOnly = true;
        }

        isolationMode = level;

        if (isolationMode != isolationModeDefault) {
            database.logger.writeToLog(this, getTransactionIsolationSQL());
        }
    }
531756
protected TwoPhaseCommitSinkFunction<IN, TXN, CONTEXT> setTransactionTimeout(long transactionTimeout) {
		checkArgument(transactionTimeout >= 0, "transactionTimeout must not be negative");
		this.transactionTimeout = transactionTimeout;
		return this;
	}
142478
async def pop_transaction_async(self):
        
        depth = self.transaction_depth_async()
        if depth > 0:
            depth -= 1
            self._task_data.set('depth', depth)
            if depth == 0:
                conn = self._task_data.get('conn')
                self._async_conn.release(conn)
        else:
            raise ValueError("Invalid async transaction depth value")
1111477
def unique(transactions):
    
    seen = set()
    # TODO: Handle comments
    return [x for x in transactions if not (x in seen or seen.add(x))]
558235
private function resetTransactionNestingLevel(): void
    {
        if (!$this->selfReflectionNestingLevelProperty instanceof \ReflectionProperty) {
            $reflection                               = new \ts\Reflection\ReflectionClass(Connection::class);
            $this->selfReflectionNestingLevelProperty = $reflection->getProperty('transactionNestingLevel');
            $this->selfReflectionNestingLevelProperty->setAccessible(true);
        }

        $this->selfReflectionNestingLevelProperty->setValue($this, 0);
    }
500088
private void closeConnectionAfterBatch(Connection conn, int initialIsolation) throws SQLException {
        if (_isDB2)
        {
            if (Connection.TRANSACTION_REPEATABLE_READ != initialIsolation && Connection.TRANSACTION_SERIALIZABLE != initialIsolation)
                try
                {
                    conn.setTransactionIsolation(initialIsolation);
                } catch (Exception e)
                {
                    if (tc.isDebugEnabled())
                        Tr.debug(tc, "setTransactionIsolation threw Exception. Specified transaction isolation level was " + initialIsolation + " ", e);
                    FFDCFilter.processException(e, "com.ibm.ws.recoverylog.spi.SQLMultiScopeRecoveryLog.closeConnectionAfterBatch", "3696", this);
                    if (!isolationFailureReported)
                    {
                        isolationFailureReported = true;
                        Tr.warning(tc, "CWRLS0024_EXC_DURING_RECOVERY", e);
                    }
                }
        }
        conn.close();
    }
920698
@Override
	public void setRollbackOnly() {
		Optional<LocalTransactionContext> txContext = currentTxContext();
		if (txContext.isPresent()) {
			txContext.get().setRollbackOnly();
		} else {
			this.unmanagedTransaction.ifPresent(LocalTransactionContext::setRollbackOnly);
		}
	}
891246
public static void startTransaction() {
        Connection connection = tl_conn.get();
        if (connection != null) {
            throw new RuntimeException(
                    "You have started a Transaction and can not start transaction repeatedly for the same connection!");
        }

        try {
            connection = JDBCUtils.getConnection();
            connection.setAutoCommit(false);
            tl_conn.set(connection);
            tl_sp.set(new Stack<Savepoint>());
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
    }
799511
public void clearLockSuspending() {
      Transaction tx = null;
      try {
         // if there is an ongoing transaction we need to suspend it
         if ((tx = tm.getTransaction()) != null) {
            tm.suspend();
         }
         clearLock();
      }
      catch (Exception e) {
         log.errorSuspendingTransaction(e);
      }
      finally {
         if (tx != null) {
            try {
               tm.resume(tx);
            } catch (Exception e) {
               throw new CacheException("Unable to resume suspended transaction " + tx, e);
            }
         }
      }
   }
458181
function (connection) {
        delete Transaction.connections[connection.transactionId];
        connection.transactionId = null;
        connection.transactionConfig = null;
    }
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);
        }
    }
979155
def clear_transaction(self):
        
        with self._transaction_lock:
            local = self._transaction_local
            if not local.pipes:
                raise ValueError('No transaction is currently active.')
            local.abort()
64460
public void releaseConnection()
    {
        if (this.con == null)
        {
            return;
        }
        if(isInLocalTransaction())
        {
            log.error("Release connection: connection is in local transaction, missing 'localCommit' or" +
                    " 'localRollback' call - try to rollback the connection");
            localRollback();
        }
        else
        {
            this.connectionFactory.releaseConnection(this.jcd, this.con);
            this.con = null;
            this.batchCon = null;
        }
    }
649083
public static function ignoreTransaction()
    {
        if (self::$mode !== self::MODE_DISABLED) {
            self::$mode = self::MODE_DISABLED;

            if (self::$extension === self::EXTENSION_XHPROF) {
                xhprof_disable();
            } else if (self::$extension === self::EXTENSION_TIDEWAYS) {
                tideways_disable();
            }
        }
    }
433377
void releaseAll(long txNum, boolean sLockOnly) {
		Set<Object> objectsToRelease = getObjectSet(txNum);
		for (Object obj : objectsToRelease) {
			Object anchor = getAnchor(obj);
			synchronized (anchor) {
				Lockers lks = lockerMap.get(obj);

				if (lks != null) {

					if (hasSLock(lks, txNum))
						releaseLock(lks, anchor, txNum, S_LOCK);

					if (hasXLock(lks, txNum) && !sLockOnly)
						releaseLock(lks, anchor, txNum, X_LOCK);

					if (hasSixLock(lks, txNum))
						releaseLock(lks, anchor, txNum, SIX_LOCK);

					while (hasIsLock(lks, txNum))
						releaseLock(lks, anchor, txNum, IS_LOCK);

					while (hasIxLock(lks, txNum) && !sLockOnly)
						releaseLock(lks, anchor, txNum, IX_LOCK);

					// Remove the locker, if there is no other transaction
					// having it
					if (!sLocked(lks) && !xLocked(lks) && !sixLocked(lks)
							&& !isLocked(lks) && !ixLocked(lks)
							&& lks.requestSet.isEmpty())
						lockerMap.remove(obj);
				}
			}
		}
		txWaitMap.remove(txNum);
		txnsToBeAborted.remove(txNum);
		lockByMap.remove(txNum);
	}
668976
def execute_remove(self, remove):
		''' 
		'''

		safe = self.safe
		if remove.safe is not None:
			safe = remove.safe

		self.queue.append(RemoveOp(self.transaction_id, self, remove.type, safe, remove))
		if self.autoflush:
			return self.flush()
459603
public void doFinally() {
        if (conn != null) {
            try {
                if ((isolation != Connection.TRANSACTION_NONE)
                        && (isolation != origIsolation)) {
                    conn.setTransactionIsolation(origIsolation);
                }
                conn.setAutoCommit(true);
                conn.close();
            } catch (SQLException e) {
                // Not much we can do
            }
        }
        conn = null;
        isolation = Connection.TRANSACTION_NONE;
    }