setTransaction
@param TransactionInterface $transaction
@return void
510408
private function setTransaction(TransactionInterface $transaction) {
        $transactions = $this->getTransactions();
        $transactions[$this->getDbService()] = $transaction;
        $this->setTransactions($transactions);
    }
89928
protected function setTransactionId(Payment $payment, $transactionId) {
        $payment->setTransactionId($transactionId);
        $payment->setLastTransId($transactionId);
        $payment->setCcTransId($transactionId);
    }
529459
protected function execute(InputInterface $input, OutputInterface $output) {
		$trn_running = \Skeleton\Transaction\Transaction::get_running();
		$trn_runnable = \Skeleton\Transaction\Transaction::get_runnable();
		$trn_scheduled = \Skeleton\Transaction\Transaction::get_scheduled();

		$table = new Table($output);

		$table->setHeaders(['ID', 'Type', 'Scheduled at', '//']);

		$rows = [];

		$rows[] = [ new TableCell('Running', array('colspan' => 4)) ];
		$rows[] = new TableSeparator();
		$running_count = 0;
		foreach ($trn_running as $transaction) {
			if ($transaction->parallel == 0) {
				$rows[] = [ $transaction->id, $transaction->classname, $transaction->scheduled_at, $this->show_parallel($transaction) ];
				$running_count++;
			}
		}
		if ($running_count == 0) {
			$rows[] = [ 'FREE', 'FREE', 'FREE', 'NO' ];
			$running_count++;
		}
		foreach ($trn_running as $transaction) {
			if ($transaction->parallel == 1) {
				$rows[] = [ $transaction->id, $transaction->classname, $transaction->scheduled_at, $this->show_parallel($transaction) ];
				$running_count++;
			}
		}
		for ($i = $running_count; $i < \Skeleton\Transaction\Config::$max_processes; $i++) {
			$rows[] = [ 'FREE', 'FREE', 'FREE', '' ];
		}

		$rows[] = new TableSeparator();

		$rows[] = [ new TableCell('Ready to run', array('colspan' => 3)) ];
		$rows[] = new TableSeparator();
		foreach ($trn_runnable as $transaction) {
			$rows[] = [ $transaction->id, $transaction->classname, $transaction->scheduled_at, $this->show_parallel($transaction) ];
		}
		if (sizeof($trn_runnable) == 0) {
			$rows[] = [ '/', '/', '/', '/' ];
		}

		$rows[] = new TableSeparator();
		$rows[] = [ new TableCell('Scheduled', array('colspan' => 3)) ];
		$rows[] = new TableSeparator();
		foreach ($trn_scheduled as $transaction) {
			$rows[] = [ $transaction->id, $transaction->classname, $transaction->scheduled_at, $this->show_parallel($transaction) ];
		}
		if (sizeof($trn_scheduled) == 0) {
			$rows[] = [ '/', '/', '/', '/' ];
		}
		$table->setRows($rows);
		$table->render();

		return 0;
	}
1150677
public function setProduct(ProductInterface $product)
    {
        $this->productId = $product->getId();
        $this->product = $product;
    }
1274840
public function beginTransaction( $autoCommit = 1 )
	{
		$this->openTransactions ++;
		if( $this->openTransactions == 1 )
		{
			if( $autoCommit )
			{
				$query = "SET AUTOCOMMIT=0";
			}
			$this->Execute( $query );
			$query = "START TRANSACTION";
			$this->Execute ($query);
		}
	}
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();
        }
    }
406767
public function transactionCommit()
    {
        if (empty($this->oDb)) {
            $this->connect();
        }

        try {

            $this->oDb->commit();
            $this->transactionRunning = false;

            return true;

        } catch (\Exception $e) {
            throw new TransactionException($e->getMessage(), $e->getCode());
        }
    }
133532
public function rollbackTransaction()
    {
        if (!self::$transaction) {
            throw new TransactionException("There is no Active Transaction");
        }

        self::$transaction = false;
        foreach (self::$connectionList as $dbDriver) {
            $dbDriver->rollbackTransaction();
        }
    }
1095557
public function handleVersionTwo(Transaction $transaction): Transaction
    {
        $transaction->id = Hash::sha256($transaction->serialize())->getHex();

        return $transaction;
    }
606867
public function delete(TransactionInterface $transaction = null)
    {
        if (empty($transaction)) {
            /*
             * When no transaction is given we will create our own and run it immediately.
             */
            $transaction = $transaction ?? new Transaction();
            $transaction->delete($this);
            $transaction->run();
        } else {
            $transaction->addCommand($this->queueDelete());
        }
    }
294182
public function setTransactionIsolation($isolation)
    {
        if (!$this->getPlatform()->supportTransactionIsolations()) {
            throw ConnectionException::transactionIsolationNotSupported();
        }

        $this->executeUpdate($this->getPlatform()->getSetTransactionIsolationSQLQuery($isolation));
        $this->transactionIsolation = $isolation;
    }
54443
public void beginTransaction() throws HibernateException
    {
        Transaction tx = threadTransaction.get();
        if (tx == null)
        {
            tx = getSession().beginTransaction();
            threadTransaction.set(tx);
        }
    }
1208471
public function addTransaction(Transaction $transaction)
    {
        if ($transaction->getAccount() !== $this) {
            $transaction->setAccount($this);
        }

        $this->transactions[] = $transaction;
    }
1068657
public function setNetwork(Transaction\NetworkType $network)
    {
        if ($this->isTransacted() || $this->parent) {
            return;
        }

        $this->network = $network;
    }
1102693
public static function run_transaction(Transaction $transaction) {
		ob_start();
		echo date('[r] ') . 'Running ' . $transaction->classname . ' - ' . $transaction->id . "\n";

		$failed = false;
		try {
			$transaction->run();
		} catch (\Throwable $e) {
			$failed = true;
		} catch (\Exception $e) {
			$failed = true;
		}
		echo "\n";
		echo date('[r] ') . 'Finished ' . $transaction->classname . ' - ' . $transaction->id . "\n";

		$content = ob_get_contents();
		ob_get_clean();

		if ($failed) {
			$transaction->mark_failed($content, $e);
		} else {
			$transaction->mark_completed($content);
		}
	}
1048029
public function commit()
    {
        if (!$this->transactor instanceof TransactionInterface) {
            throw new OrmException("Connection not set");
        }

        $this->checkForChangedRelations();
        $this->checkForUpdates();
        $this->preCommit();
        $this->transactor->beginTransaction();

        try {
            $this->insert();
            $this->update();
            $this->delete();
            $this->transactor->commit();
        } catch (\Exception $e) {
            $this->transactor->rollBack();
            $this->postRollback();
            throw new OrmException("Commit failed.\n" . $e->getMessage(), 0, $e);
        }

        $this->postCommit();

        // Clear our schedules
        $this->scheduledForInsertion = [];
        $this->scheduledForUpdate    = [];
        $this->scheduledForDeletion  = [];
        $this->entityRegistry->clearAggregateRoots();
    }
690309
public function commit()
    {
        if ($this->disableTransactionHandling) {
            return;
        }

        if (null === $this->session) {
            throw new RuntimeAdapterException('Transaction not started');
        }

        $this->session->commitTransaction();
        $this->session->endSession();
        $this->session = null;
    }