Starts a transaction. Doing this will set auto commit to false ({@link Connection#getAutoCommit()}).

@throws DatabaseEngineRuntimeException If something goes wrong while beginning transaction.
421126
@Override
    public synchronized void beginTransaction() throws DatabaseEngineRuntimeException {
        /*
         * It makes sense trying to reconnect since it's the beginning of a transaction.
         */
        try {
            getConnection();
            if (!conn.getAutoCommit()) { //I.E. Manual control
                logger.debug("There's already one transaction active");
                return;
            }

            conn.setAutoCommit(false);
        } catch (final Exception ex) {
            throw new DatabaseEngineRuntimeException("Error occurred while starting transaction", ex);
        }
    }
248066
public HibernateTransaction start()
	{
		final Session session = sessionProvider.get();
		final Transaction tx = session.beginTransaction();

		return new HibernateTransaction(tx);
	}
987531
protected function beginTransaction($autoCommit = false): void
    {
        if (!$autoCommit && null !== $this->connection) {
            $this->connection->beginTransaction();
        }
    }
1161535
public function commit()
    {
        if ($this->transactionInProgress === true) {

            $this->Benchmark->start('sql-trans');

            if ($this->getConnection()->commit() === false)
                throw new DatabaseException('TRANSACTION COMMIT FAILED');

            $this->Logger->debug(array(
                            'Conn'                => $this->connDebugString,
                            'SQL'                 => 'COMMIT',
                            'Execution Time (ms)' => $this->Benchmark->end('sql-trans'),
                        ));
        }

        $this->transactionInProgress  = false;
        //$this->shouldStartTransaction = false;

    }
1276451
public function beginTransaction() {
		if ($this->inTransaction()) {
			throw new Exception('Transaction already is active');
		}
		$this->_inTransaction = true;
		$this->_commitMode = (PHP_VERSION_ID >= 503020) ? OCI_NO_AUTO_COMMIT : OCI_DEFAULT;

		return true;
	}
54443
public void beginTransaction() throws HibernateException
    {
        Transaction tx = threadTransaction.get();
        if (tx == null)
        {
            tx = getSession().beginTransaction();
            threadTransaction.set(tx);
        }
    }
1153776
public final function transactionCommit()
    {
        if (1 == $this->intTransactionDepth) {
            $this->executeTransactionCommit();
        }
        if ($this->intTransactionDepth <= 0) {
            throw new Caller("The transaction commit call is called before the transaction begin was called.");
        }
        $this->intTransactionDepth--;
    }
1295032
public final T execute()
   {
      boolean txOwner = !TransactionElf.hasTransactionManager() || TransactionElf.beginOrJoinTransaction();
      Connection connection = null;
      try {
         connection = ConnectionProxy.wrapConnection(dataSource.getConnection());
         if (txOwner) {
            // disable autoCommit mode as we are going to handle transaction by ourselves
            connection.setAutoCommit(false);
         }
         return (args == null)
            ? execute(connection)
            : execute(connection, args);
      }
      catch (SQLException e) {
         if (e.getNextException() != null) {
            e = e.getNextException();
         }
         if (txOwner) {
            // set the txOwner to false as we no longer own the transaction and we shouldn't try to commit it later
            txOwner = false;
            rollback(connection);
         }
         throw new RuntimeException(e);
      } catch (Throwable e) {
         if (txOwner) {
            txOwner = false;
            rollback(connection);
         }
         throw e;
      }
      finally {
         try {
            if (txOwner) {
               commit(connection);
            }
         }
         finally {
            quietClose(connection);
         }
      }
   }
302001
public function start_transaction()
	{
		$result = true;

		if ($this->_transaction_depth == 0)
		{
			if ($this->driver_start_transaction())
			{
				$this->_in_transaction = true;
			}
			else
			{
				$result = false;
			}
		}
		else
		{
			$result = $this->set_savepoint($this->_transaction_depth);
			// If savepoint is not supported it is not an error
			isset($result) or $result = true;
		}

		$result and $this->_transaction_depth ++;

		return $result;
	}
1193892
public void commit() throws DBException
    {
        super.commit();   // Will throw an error if something is not set up right.
        try   {
            if (m_JDBCConnection != null)
                m_JDBCConnection.commit();
        } catch (SQLException ex) {
            throw this.convertError(ex);
        }
    }
1005881
@Override
    public synchronized void setAutoCommit(boolean autocommit) {

        if (isClosed) {
            return;
        }

        if (autocommit != isAutoCommit) {
            commit(false);

            isAutoCommit = autocommit;
        }
    }
664301
@Override
	public AppEngineTransaction beginTransaction() {
		if (isTransactional()) {
			throw new IllegalStateException("Transaction has already started ["
					+ transaction.get().id() + "]");
		}
		
		AppEngineTransaction tx = new AppEngineTransaction(this);
		transaction.set(tx);
		logger.fine("Transaction [" + transaction.get().id() + "] started");
		return tx;
	}
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);
		}
	}
425981
public function transactionStart()
    {
        if (empty($this->oDb)) {
            $this->connect();
        }

        try {

            $this->oDb->beginTransaction();
            $this->transactionRunning = true;

            return true;

        } catch (\Exception $e) {
            throw new TransactionException($e->getMessage(), $e->getCode());
        }
    }
624005
boolean assertAutoCommit() {
    if (!assertConnection()) {
      return false;
    }

    try {
      if (getDatabaseConnection().connection.getAutoCommit()) {
        return error(loc("autocommit-needs-off"));
      }
    } catch (Exception e) {
      return error(e);
    }

    return true;
  }
110807
@Override
	public void commit() throws TransactionManagementException {
		logger.entering(CLASSNAME, "commit");
		try {
			userTran.commit();
			logger.log(Level.FINE, "javax.transaction.Status: {0}", userTran.getStatus());
		} catch (SecurityException e) {
			throw new TransactionManagementException(e);
		} catch (IllegalStateException e) {
			throw new TransactionManagementException(e);
		} catch (RollbackException e) {
			throw new TransactionManagementException(e);
		} catch (HeuristicMixedException e) {
			throw new TransactionManagementException(e);
		} catch (HeuristicRollbackException e) {
			throw new TransactionManagementException(e);
		} catch (SystemException e) {
			throw new TransactionManagementException(e);
		}
		logger.exiting(CLASSNAME, "commit");
	}
813465
public void commitTransaction() throws SystemException
   {
      Long key = Long.valueOf(Thread.currentThread().getId());
      TransactionImpl tx = txs.get(key);
      if (tx != null)
      {
         try
         {
            tx.commit();
         }
         catch (Throwable t)
         {
            SystemException se = new SystemException("Error during commit");
            se.initCause(t);
            throw se;
         }
      }
      else
      {
         throw new IllegalStateException("No transaction to commit");
      }
   }