Behaves like startOrContinueTransaction(), but with a custom transaction style
@param style defines the parameters for this transaction.
@return
@throws MithraTransactionException
189608
public MithraTransaction startOrContinueTransaction(TransactionStyle style) throws MithraTransactionException
    {
        MithraTransaction result;
        MithraTransaction parent = this.getCurrentTransaction();
        if (parent != null)
        {
            result = new MithraNestedTransaction(parent);
        }
        else
        {
            Transaction jtaTx;
            try
            {
                if (this.getJtaTransactionManager().getStatus() != Status.STATUS_ACTIVE)
                {
                    this.getJtaTransactionManager().setTransactionTimeout(style.getTimeout());
                    this.getJtaTransactionManager().begin();
                }
                jtaTx = this.getJtaTransactionManager().getTransaction();
                result = this.createMithraRootTransaction(jtaTx, style.getTimeout()*1000);
            }
            catch (NotSupportedException e)
            {
                throw new MithraTransactionException("JTA exception", e);
            }
            catch (SystemException e)
            {
                throw new MithraTransactionException("JTA exception", e);
            }
            catch (RollbackException e)
            {
                throw new MithraTransactionException("JTA exception", e);
            }
        }
        this.setThreadTransaction(result);
        return result;
    }
859851
private void beginInternTransaction()
    {
        if (log.isDebugEnabled()) log.debug("beginInternTransaction was called");
        J2EETransactionImpl tx = (J2EETransactionImpl) super.currentTransaction();
        if (tx == null) tx = newInternTransaction();
        if (!tx.isOpen())
        {
            // start the transaction
            tx.begin();
            tx.setInExternTransaction(true);
        }
    }
737497
@Override
	protected FlinkKafkaProducer.KafkaTransactionState beginTransaction() throws FlinkKafkaException {
		switch (semantic) {
			case EXACTLY_ONCE:
				FlinkKafkaInternalProducer<byte[], byte[]> producer = createTransactionalProducer();
				producer.beginTransaction();
				return new FlinkKafkaProducer.KafkaTransactionState(producer.getTransactionalId(), producer);
			case AT_LEAST_ONCE:
			case NONE:
				// Do not create new producer on each beginTransaction() if it is not necessary
				final FlinkKafkaProducer.KafkaTransactionState currentTransaction = currentTransaction();
				if (currentTransaction != null && currentTransaction.producer != null) {
					return new FlinkKafkaProducer.KafkaTransactionState(currentTransaction.producer);
				}
				return new FlinkKafkaProducer.KafkaTransactionState(initNonTransactionalProducer(true));
			default:
				throw new UnsupportedOperationException("Not implemented semantic");
		}
	}
622454
public <T> T withTransaction(@NotNull Propagation propagation,
                                 @NotNull Isolation isolation,
                                 @NotNull TransactionCallback<T> callback) {

        TransactionSettings settings = new TransactionSettings();
        settings.setPropagation(propagation);
        settings.setIsolation(isolation);

        return withTransaction(settings, callback);
    }
77653
public final <T> T executeInTransaction(final Runnable<T> runnable) throws Exception {
        return executeInTransaction(runnable, true);
    }
571818
public void beginAction(Session session, Statement cs) {

        synchronized (liveTransactionTimestamps) {
            session.actionTimestamp = nextChangeTimestamp();

            if (!session.isTransaction) {
                session.transactionTimestamp = session.actionTimestamp;
                session.isTransaction        = true;

                liveTransactionTimestamps.addLast(session.actionTimestamp);

                try {
                    if (this.mvcc) {
                        database.logger.writeToLog(
                            session, session.getStartTransactionSQL());
                    }
                } catch (HsqlException e) {}
            }
        }

        if (session.isReadOnly()) {
            return;
        }

        if (!mvcc) {
            if (session.hasLocks()) {
                return;
            }

            try {
                writeLock.lock();

                boolean canProceed = beginActionTPL(session, cs);

                if (!canProceed) {
                    session.abortTransaction = true;
                }
/* debug 190
                if (!canProceed) {
                    System.out.println("******* cannot start");
                }
// debug 190 */
            } finally {
                writeLock.unlock();
            }
        }
    }
866811
public static TransactionContext getTransactionContext(HazelcastInstance hazelcastInstance) {
        TransactionContextHolder transactionContextHolder =
                (TransactionContextHolder) TransactionSynchronizationManager.getResource(hazelcastInstance);
        if (transactionContextHolder == null) {
            throw new NoTransactionException("No TransactionContext with actual transaction available for current thread");
        }
        return transactionContextHolder.getContext();
    }
751046
void addTransaction(Transaction t, boolean runSanityChecks) {
        unCacheTransactions();
        if (transactions == null) {
            transactions = new ArrayList<>();
        }
        t.setParent(this);
        if (runSanityChecks && transactions.size() == 0 && !t.isCoinBase())
            throw new RuntimeException("Attempted to add a non-coinbase transaction as the first transaction: " + t);
        else if (runSanityChecks && transactions.size() > 0 && t.isCoinBase())
            throw new RuntimeException("Attempted to add a coinbase transaction when there already is one: " + t);
        transactions.add(t);
        adjustLength(transactions.size(), t.length);
        // Force a recalculation next time the values are needed.
        merkleRoot = null;
        hash = null;
    }
1226255
public void beginTransaction() throws SQLException {
		final Connection conn = getConnection();
		checkTransactionSupported(conn);
		conn.setAutoCommit(false);
	}
65193
protected void doBegin(Object transaction, TransactionDefinition definition) {
        ContextSourceAndDataSourceTransactionObject actualTransactionObject = (ContextSourceAndDataSourceTransactionObject) transaction;

        super.doBegin(actualTransactionObject.getDataSourceTransactionObject(),
                definition);
        try {
            ldapManagerDelegate.doBegin(actualTransactionObject
                    .getLdapTransactionObject(), definition);
        } catch (TransactionException e) {
            // Failed to start LDAP transaction - make sure we clean up properly
            super.doCleanupAfterCompletion(actualTransactionObject.getDataSourceTransactionObject());
            throw e;
        }
    }
748224
public void setStyle(final TableStyle style) {
        this.stylesContainer.addPageStyle(style.getPageStyle());
        this.stylesContainer.addContentStyle(style);
        this.style = style;
    }
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);
        }
    }
733359
private void beginTransaction() {

		if (currentTransaction == null) {

			try {
				currentTransaction = StructrApp.getInstance(securityContext).tx(true, false, false);

			} catch (FrameworkException fex) {

				// transaction can fail here (theoretically...)
				logger.warn("Unable to begin transaction.", fex);
			}
		}
	}
1129089
public static boolean startTransaction(Connection conn) throws SQLException {
        if (conn == null) {
            return false;
        }
        String dsName = openConnDsName.get().get(conn);
        OpenConnStats connStats = dsName != null ? openConnStats.get().get(dsName) : null;
        if (connStats != null && !connStats.inTransaction) {
            conn.setAutoCommit(false);
            connStats.inTransaction = true;
            return true;
        }
        return false;
    }
875321
@Override
	public void begin() throws TransactionManagementException {
		logger.entering(CLASSNAME, "begin");
		
		try {
			userTran.begin();
			logger.log(Level.FINE, "javax.transaction.Status: {0}", userTran.getStatus());
		} catch (NotSupportedException e) {
			throw new TransactionManagementException(e);
		} catch (SystemException e) {
			throw new TransactionManagementException(e);
		}
		logger.exiting(CLASSNAME, "begin");
	}
903867
@Override
	public void setTransactionTimeout(int seconds) throws TransactionManagementException {
		logger.entering(CLASSNAME, "setTransactionTimeout", seconds);
		try {
			userTran.setTransactionTimeout(seconds);
		} catch (SystemException e) {
			throw new TransactionManagementException(e);
		}
		logger.exiting(CLASSNAME, "setTransactionTimeout");
	}
1234924
@Deprecated
    @Override
    public SQLTransaction beginTransaction(IsolationLevel isolationLevel, boolean forUpdateOnly) {
        return super.beginTransaction(isolationLevel, forUpdateOnly);
    }