Checks if the connection has a transaction initialized
965457
protected function checkTransaction() {
        if(null !== $this->con && !$this->con->inTransaction()) {
            $this->con->beginTransaction();
        }
        if(null !== $this->con && $this->con->inTransaction()) {
            $this->items++;
        }
        if($this->items >= Config::getParam('api.block.limit', 1000)) {
            $this->con->commit();
            $this->items = 0;
        }
    }
789096
void localTransactionStarted(final SibRaConnection connection) {

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, "localTransactionStarted", connection);
        }

        final ConnectionEvent event = new ConnectionEvent(this,
                ConnectionEvent.LOCAL_TRANSACTION_STARTED);
        event.setConnectionHandle(connection);

        for (Iterator iterator = _eventListeners.iterator(); iterator.hasNext();) {

            final ConnectionEventListener listener = (ConnectionEventListener) iterator
                    .next();
            listener.localTransactionStarted(event);

        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, "localTransactionStarted");
        }
    }
251596
public static boolean isUncommitted(Transaction tx)
   {
      if (tx == null)
         return false;
      
      try
      {
         int status = tx.getStatus();

         return status == Status.STATUS_ACTIVE || status == Status.STATUS_MARKED_ROLLBACK;
      }
      catch (SystemException error)
      {
         throw new RuntimeException("Error during isUncommitted()", error);
      }
   }
548937
protected boolean isDbInitialized(final Connection con)
   {
      return SecurityHelper.doPrivilegedAction(new PrivilegedAction<Boolean>()
      {

         public Boolean run()
         {
            return JDBCUtils.tableExists(configTableName, con);
         }
      });
   }
1314400
private void setupConnection(final Connection connection) throws ConnectionSetupException
   {
      try {
         if (networkTimeout == UNINITIALIZED) {
            networkTimeout = getAndSetNetworkTimeout(connection, validationTimeout);
         }
         else {
            setNetworkTimeout(connection, validationTimeout);
         }

         if (connection.isReadOnly() != isReadOnly) {
            connection.setReadOnly(isReadOnly);
         }

         if (connection.getAutoCommit() != isAutoCommit) {
            connection.setAutoCommit(isAutoCommit);
         }

         checkDriverSupport(connection);

         if (transactionIsolation != defaultTransactionIsolation) {
            connection.setTransactionIsolation(transactionIsolation);
         }

         if (catalog != null) {
            connection.setCatalog(catalog);
         }

         if (schema != null) {
            connection.setSchema(schema);
         }

         executeSql(connection, config.getConnectionInitSql(), true);

         setNetworkTimeout(connection, networkTimeout);
      }
      catch (SQLException e) {
         throw new ConnectionSetupException(e);
      }
   }
1129724
def begin_pending_transactions(self):
        """"""
        while not self._pending_sessions.empty():
            session = self._pending_sessions.get()
            session._transaction.begin()
            super(TransactionPingingPool, self).put(session)
612410
function StartTransaction()
	{
		if ($this->IsTransactionInProgress())
			throw new Exception('Transaction is already in progress.  Commit or rollback must be called before beginning a new transaction');
		
		if ($this->ConnectionSetting->IsReadOnlySlave)
			throw new Exception('Transactions are not allowed on a read-only slave');
		
		$this->RequireConnection(true);
		$this->Observe("DataAdapter ($this->_label) (DataAdapter.StartTransaction)", OBSERVE_QUERY);
		$this->_transactionInProgress = true;
		return $this->_driver->StartTransaction($this->_dbconn);
	}
661423
public void reconnect() throws SQLException {
    boolean inTransaction = currentProtocol != null && currentProtocol.inTransaction();
    reconnectFailedConnection(new SearchFilter(true, false));
    handleFailLoop();
    if (inTransaction) {
      throw new ReconnectDuringTransactionException(
          "Connection reconnect automatically during an active transaction", 1401, "25S03");
    }
  }
1081955
public final void beginTransaction(GlobalTransaction globalTransaction, boolean local) {
      if (local) {
         //Not overriding the InitialValue method leads me to have "null" at the first invocation of get()
         TransactionStatistics lts = createTransactionStatisticIfAbsent(globalTransaction, true);
         if (trace) {
            log.tracef("Local transaction statistic is already initialized: %s", lts);
         }
      } else {
         TransactionStatistics rts = createTransactionStatisticIfAbsent(globalTransaction, false);
         if (trace) {
            log.tracef("Using the remote transaction statistic %s for transaction %s", rts, globalTransaction);
         }
      }
   }
1181379
public final boolean isTransactional() {
        // Take a snapshot of the value with first use (or reuse from pool) of the managed connection.
        // This value will be cleared when the managed connection is returned to the pool.
        if (transactional == null) {
            transactional = mcf.dsConfig.get().transactional;
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(this, tc, "transactional=", transactional);
        }

        return transactional;
    }
1275924
public static boolean beginOrJoinTransaction()
   {
      boolean newTransaction = false;
      try {
         newTransaction = userTransaction.getStatus() == Status.STATUS_NO_TRANSACTION;
         if (newTransaction) {
            userTransaction.begin();
         }
      }
      catch (Exception e) {
         throw new RuntimeException("Unable to start transaction.", e);
      }

      return newTransaction;
   }
786032
@Override
  public void start()
  {
    LOGGER.debug("Start Loading");
    // validate parameters
    validateParameters();

    if (_op == null)
    {
      this.abort(new ConnectionError("Loader started with no operation"));
      return;
    }

    initDateFormats();

    initQueues();

    if (_is_first_start_call)
    {
      // is this the first start call?

      try
      {
        if (_startTransaction)
        {
          LOGGER.debug("Begin Transaction");
          _processConn.createStatement().execute("begin transaction");
        }
        else
        {
          LOGGER.debug("No Transaction started");
        }
      }
      catch (SQLException ex)
      {
        abort(new Loader.ConnectionError("Failed to start Transaction",
                                         Utils.getCause(ex)));
      }

      if (_truncate)
      {
        truncateTargetTable();
      }

      try
      {
        if (_before != null)
        {
          LOGGER.debug("Running Execute Before SQL");
          _processConn.createStatement().execute(_before);
        }
      }
      catch (SQLException ex)
      {
        abort(new Loader.ConnectionError(
            String.format("Execute Before SQL failed to run: %s", _before),
            Utils.getCause(ex)));
      }
    }
  }
866518
protected boolean beginTransaction(SQLiteDatabase db) {
		boolean endTransaction = false;
		if (!db.inTransaction()) {
			db.beginTransaction();
			endTransaction = true;
			LOGGER.trace("Begin transaction");
		}
		return endTransaction;
	}
445174
public void initConnection()
    {
        try   {
            boolean bAutoCommit = true;
            if (DBConstants.FALSE.equalsIgnoreCase(this.getProperty(SQLParams.AUTO_COMMIT_PARAM)))
                bAutoCommit = false;
            m_JDBCConnection.setAutoCommit(bAutoCommit);
            DatabaseMetaData dma = m_JDBCConnection.getMetaData();
            String strDatabaseProductName = dma.getDatabaseProductName();
            Utility.getLogger().info("DB Name: " + strDatabaseProductName);
            this.setProperty(SQLParams.INTERNAL_DB_NAME, strDatabaseProductName);
            this.setupDatabaseProperties(); // If I haven't read the db properties, read them now!
            String strDateQuote = this.getProperty(SQLParams.SQL_DATE_QUOTE);
            if ((strDateQuote != null) && (strDateQuote.length() > 0))
                DateTimeField.setSQLQuote(strDateQuote.charAt(0));
            Converter.initGlobals();
            String strFormat = this.getProperty(SQLParams.SQL_DATE_FORMAT);
            if (strFormat != null)
                Converter.gDateSqlFormat = new java.text.SimpleDateFormat(strFormat);
            strFormat = this.getProperty(SQLParams.SQL_TIME_FORMAT);
            if (strFormat != null)
                Converter.gTimeSqlFormat = new java.text.SimpleDateFormat(strFormat);
            strFormat = this.getProperty(SQLParams.SQL_DATETIME_FORMAT);
            if (strFormat != null)
                Converter.gDateTimeSqlFormat = new java.text.SimpleDateFormat(strFormat);
            if (DBConstants.TRUE.equals(this.getProperty(SQLParams.SHARE_JDBC_CONNECTION)))
                m_sharedConnection = m_JDBCConnection;  // HACK - Only one DB open at a time (pointbase)!
            Utility.getLogger().info("Connected to db: " + this.getDatabaseName(true));
        }
        catch (SQLException ex)
        {
            // Ignore errors to these non-essential calls;  // Probably "DB Not found"
        }
    }
965001
public function initialize()
    {
        return !is_null($this->transactionRef) ?
           $this->getTransactionResource()->initialize($this->_requestPayload()) :
            new PaystackInvalidTransactionException(
                json_decode(
                    json_encode(
                        [
                            'message' => 'Transaction Reference Not Generated.',
                        ]
                    ),
                    false
                )
            );
    }
975337
public function isSuccessful()
    {
        if (isset($this->data['object']) && 'transaction' === $this->data['object']) {
            return !($this->data['status'] == 'refused');
        }
        return !isset($this->data['errors']);
    }
1328815
protected boolean isExistingTransaction(Object transaction) {
        ContextSourceAndHibernateTransactionObject actualTransactionObject = (ContextSourceAndHibernateTransactionObject) transaction;

        return super.isExistingTransaction(actualTransactionObject
                .getHibernateTransactionObject());
    }