/** * Helper method to create a TxScope with MANDATORY. */ public static TxScope mandatory() { return new TxScope(TxType.MANDATORY); }
public ScopeTrans(boolean rollbackOnChecked, boolean created, SpiTransaction transaction, TxScope txScope, SpiTransaction suspendedTransaction, SpiTransactionScopeManager scopeMgr) { this.rollbackOnChecked = rollbackOnChecked; this.created = created; this.transaction = transaction; this.suspendedTransaction = suspendedTransaction; this.scopeMgr = scopeMgr; this.noRollbackFor = txScope.getNoRollbackFor(); this.rollbackFor = txScope.getRollbackFor(); if (transaction != null) { if (!created && txScope.isBatchSet() || txScope.isBatchOnCascadeSet() || txScope.isBatchSizeSet()) { restoreBatch = transaction.getBatch(); restoreBatchOnCascade = transaction.getBatchOnCascade(); restoreBatchSize = transaction.getBatchSize(); restoreBatchGeneratedKeys = transaction.getBatchGetGeneratedKeys(); } if (txScope.isBatchSet()) { transaction.setBatch(txScope.getBatch()); } if (txScope.isBatchOnCascadeSet()) { transaction.setBatchOnCascade(txScope.getBatchOnCascade()); } if (txScope.isBatchSizeSet()) { transaction.setBatchSize(txScope.getBatchSize()); } if (txScope.isSkipGeneratedKeys()) { transaction.setBatchGetGeneratedKeys(false); } } }
txScope = new TxScope(); if (txScope.getType().equals(TxType.NOT_SUPPORTED)) { TxIsolation isolation = txScope.getIsolation(); if (isolation != null) { isoLevel = isolation.getLevel();
txScope = new TxScope(); } else { txScope.checkBatchMode(); if (txScope.getType().equals(TxType.NOT_SUPPORTED)) { TxIsolation isolation = txScope.getIsolation(); if (isolation != null) { isoLevel = isolation.getLevel();
public ScopeTrans(boolean rollbackOnChecked, boolean created, SpiTransaction transaction, TxScope txScope, SpiTransaction suspendedTransaction, SpiTransactionScopeManager scopeMgr) { this.rollbackOnChecked = rollbackOnChecked; this.created = created; this.transaction = transaction; this.suspendedTransaction = suspendedTransaction; this.scopeMgr = scopeMgr; this.noRollbackFor = txScope.getNoRollbackFor(); this.rollbackFor = txScope.getRollbackFor(); Thread t = Thread.currentThread(); originalUncaughtHandler = t.getUncaughtExceptionHandler(); t.setUncaughtExceptionHandler(this); }
/** * Create a ScopeTrans for a given methods TxScope. */ public static ScopeTrans createScopeTrans(TxScope txScope) { EbeanServer server = Ebean.getServer(txScope.getServerName()); SpiEbeanServer iserver = (SpiEbeanServer)server; return iserver.createScopeTrans(txScope); }
TxType type = scope.getType(); switch (type) { case REQUIRED:
@Override protected void doStartTx(Object delegate, boolean readOnly) { if (readOnly) { TxScope scope = TxScope.required().setReadOnly(true); ebeanReadOnly.beginTransaction(scope); } else { ebean.beginTransaction(); } }
/** * Start a transaction with 'REQUIRED' semantics. * <p> * If a transaction already exists that transaction will be used. * </p> * <p> * Note that the transaction is stored in a ThreadLocal variable. * </p> */ public Transaction beginTransaction() { return beginTransaction(TxScope.required()); }
txScope = new TxScope(); if (txScope.getType().equals(TxType.NOT_SUPPORTED)) { TxIsolation isolation = txScope.getIsolation(); if (isolation != null) { isoLevel = isolation.getLevel();
public ScopeTrans(boolean rollbackOnChecked, boolean created, SpiTransaction transaction, TxScope txScope, SpiTransaction suspendedTransaction, SpiTransactionScopeManager scopeMgr) { this.rollbackOnChecked = rollbackOnChecked; this.created = created; this.transaction = transaction; this.suspendedTransaction = suspendedTransaction; this.scopeMgr = scopeMgr; this.noRollbackFor = txScope.getNoRollbackFor(); this.rollbackFor = txScope.getRollbackFor(); Thread t = Thread.currentThread(); originalUncaughtHandler = t.getUncaughtExceptionHandler(); t.setUncaughtExceptionHandler(this); }
/** * Create a ScopeTrans for a given methods TxScope. */ public static ScopeTrans createScopeTrans(TxScope txScope) { EbeanServer server = Ebean.getServer(txScope.getServerName()); SpiEbeanServer iserver = (SpiEbeanServer) server; return iserver.createScopeTrans(txScope); }
TxType type = scope.getType(); switch (type) { case REQUIRED:
/** * Helper method to create a TxScope with REQUIRES. */ public static TxScope required() { return new TxScope(TxType.REQUIRED); }
/** * Create a ScopeTrans for a given methods TxScope. */ public static ScopeTrans createScopeTrans(TxScope txScope) { EbeanServer server = Ebean.getServer(txScope.getServerName()); SpiEbeanServer iserver = (SpiEbeanServer)server; return iserver.createScopeTrans(txScope); }
TxType type = scope.getType(); switch (type) { case REQUIRED:
/** * Helper method to create a TxScope with MANDATORY. */ public static TxScope mandatory() { return new TxScope(TxType.MANDATORY); }
/** * Helper method to create a TxScope with NOT_SUPPORTED. */ public static TxScope notSupported() { return new TxScope(TxType.NOT_SUPPORTED); }
/** * Helper method to create a TxScope with REQUIRES_NEW. */ public static TxScope requiresNew() { return new TxScope(TxType.REQUIRES_NEW); }
/** * Helper method to create a TxScope with SUPPORTS. */ public static TxScope supports() { return new TxScope(TxType.SUPPORTS); }