/** * Suspend all transaction association from the invoking thread. When this * operation returns, the thread will be associated with no transactions. * * If the current transaction is not an AtomicAction then this method will * not suspend. * * Note, we do not provide an async version of suspend because it would be * wrong for an application thread to proceed under the assumption it had * succeeded/happened yet. Ordering of events makes a difference here. * * @return a handle on the current AtomicAction (if any) so that the thread * can later resume association if required. * */ public static final Transaction suspend () { return new Transaction(AtomicAction.suspend()); }
/** * Resume transaction association on the current thread. If the specified * transaction is null, then this is the same as doing a suspend. If the * current thread is associated with transactions then those associations * will be lost. * * @param act the transaction to associate. If this is a nested * transaction, then the thread will be associated with all of * the transactions in the hierarchy. * * @return <code>true</code> if association is successful, * <code>false</code> otherwise. */ public static final boolean resume (AtomicAction act) { if (act == null) { suspend(); // If you ever change this, you need to change the way resume is handled in /ArjunaJTS/integration/src/main/java/com/arjuna/ats/jbossatx/BaseTransactionManagerDelegate.java } else ThreadActionData.restoreActions(act); return true; }
/** * Resume transaction association on the current thread. If the specified * transaction is null, then this is the same as doing a suspend. If the * current thread is associated with transactions then those associations * will be lost. * * @param act the transaction to associate. If this is a nested * transaction, then the thread will be associated with all of * the transactions in the hierarchy. * * @return <code>true</code> if association is successful, * <code>false</code> otherwise. */ public static final boolean resume (AtomicAction act) { if (act == null) { suspend(); // If you ever change this, you need to change the way resume is handled in /ArjunaJTS/integration/src/main/java/com/arjuna/ats/jbossatx/BaseTransactionManagerDelegate.java } else ThreadActionData.restoreActions(act); return true; }
/** * Resume transaction association on the current thread. If the specified * transaction is null, then this is the same as doing a suspend. If the * current thread is associated with transactions then those associations * will be lost. * * @param act the transaction to associate. If this is a nested * transaction, then the thread will be associated with all of * the transactions in the hierarchy. * * @return <code>true</code> if association is successful, * <code>false</code> otherwise. */ public static final boolean resume (AtomicAction act) { if (act == null) { suspend(); } else ThreadActionData.restoreActions(act); return true; }
/** * Resume transaction association on the current thread. If the specified * transaction is null, then this is the same as doing a suspend. If the * current thread is associated with transactions then those associations * will be lost. * * @param act the transaction to associate. If this is a nested * transaction, then the thread will be associated with all of * the transactions in the hierarchy. * * @return <code>true</code> if association is successful, * <code>false</code> otherwise. */ public static final boolean resume (AtomicAction act) { if (act == null) { suspend(); } else ThreadActionData.restoreActions(act); return true; }
/** * Resume transaction association on the current thread. If the specified * transaction is null, then this is the same as doing a suspend. If the * current thread is associated with transactions then those associations * will be lost. * * @param act the transaction to associate. If this is a nested * transaction, then the thread will be associated with all of * the transactions in the hierarchy. * * @return <code>true</code> if association is successful, * <code>false</code> otherwise. */ public static final boolean resume (AtomicAction act) { if (act == null) { suspend(); // If you ever change this, you need to change the way resume is handled in /ArjunaJTS/integration/src/main/java/com/arjuna/ats/jbossatx/BaseTransactionManagerDelegate.java } else ThreadActionData.restoreActions(act); return true; }
/** * Resume transaction association on the current thread. If the specified * transaction is null, then this is the same as doing a suspend. If the * current thread is associated with transactions then those associations * will be lost. * * @param act the transaction to associate. If this is a nested * transaction, then the thread will be associated with all of * the transactions in the hierarchy. * * @return <code>true</code> if association is successful, * <code>false</code> otherwise. */ public static final boolean resume (AtomicAction act) { if (act == null) { suspend(); } else ThreadActionData.restoreActions(act); return true; }
/** * Resume transaction association on the current thread. If the specified * transaction is null, then this is the same as doing a suspend. If the * current thread is associated with transactions then those associations * will be lost. * * @param act the transaction to associate. If this is a nested * transaction, then the thread will be associated with all of * the transactions in the hierarchy. * * @return <code>true</code> if association is successful, * <code>false</code> otherwise. */ public static final boolean resume (AtomicAction act) { if (act == null) { suspend(); } else ThreadActionData.restoreActions(act); return true; }
/** * Resume transaction association on the current thread. If the specified * transaction is null, then this is the same as doing a suspend. If the * current thread is associated with transactions then those associations * will be lost. * * @param act the transaction to associate. If this is a nested * transaction, then the thread will be associated with all of * the transactions in the hierarchy. * * @return <code>true</code> if association is successful, * <code>false</code> otherwise. */ public static final boolean resume (AtomicAction act) { if (act == null) { suspend(); // If you ever change this, you need to change the way resume is handled in /ArjunaJTS/integration/src/main/java/com/arjuna/ats/jbossatx/BaseTransactionManagerDelegate.java } else ThreadActionData.restoreActions(act); return true; }
/** * Resume transaction association on the current thread. If the specified * transaction is null, then this is the same as doing a suspend. If the * current thread is associated with transactions then those associations * will be lost. * * @param act the transaction to associate. If this is a nested * transaction, then the thread will be associated with all of * the transactions in the hierarchy. * * @return <code>true</code> if association is successful, * <code>false</code> otherwise. */ public static final boolean resume (AtomicAction act) { if (act == null) { suspend(); // If you ever change this, you need to change the way resume is handled in /ArjunaJTS/integration/src/main/java/com/arjuna/ats/jbossatx/BaseTransactionManagerDelegate.java } else ThreadActionData.restoreActions(act); return true; }
/** * Resume transaction association on the current thread. If the specified * transaction is null, then this is the same as doing a suspend. If the * current thread is associated with transactions then those associations * will be lost. * * @param act the transaction to associate. If this is a nested * transaction, then the thread will be associated with all of * the transactions in the hierarchy. * * @return <code>true</code> if association is successful, * <code>false</code> otherwise. */ public static final boolean resume (AtomicAction act) { if (act == null) { suspend(); } else ThreadActionData.restoreActions(act); return true; }
/** * @return the suspended transaction. */ public Transaction suspend() throws javax.transaction.SystemException { if (jtaLogger.logger.isTraceEnabled()) { jtaLogger.logger.trace("TransactionImpleManager.suspend"); } try { TransactionImple tx = TransactionImple.getTransaction(); if (tx != null) { tx.getAtomicAction().suspend(); } return tx; } catch (Exception e) { javax.transaction.SystemException systemException = new javax.transaction.SystemException(e.toString()); systemException.initCause(e); throw systemException; } }
/** * @return the suspended transaction. */ public Transaction suspend() throws javax.transaction.SystemException { if (jtaLogger.logger.isTraceEnabled()) { jtaLogger.logger.trace("TransactionImpleManager.suspend"); } try { TransactionImple tx = TransactionImple.getTransaction(); if (tx != null) { tx.getAtomicAction().suspend(); } return tx; } catch (Exception e) { javax.transaction.SystemException systemException = new javax.transaction.SystemException(e.toString()); systemException.initCause(e); throw systemException; } }
/** * @return the suspended transaction. */ public Transaction suspend() throws javax.transaction.SystemException { if (jtaLogger.logger.isTraceEnabled()) { jtaLogger.logger.trace("TransactionImpleManager.suspend"); } try { TransactionImple tx = TransactionImple.getTransaction(); if (tx != null) { tx.getAtomicAction().suspend(); } return tx; } catch (Exception e) { javax.transaction.SystemException systemException = new javax.transaction.SystemException(e.toString()); systemException.initCause(e); throw systemException; } }
public Future<Void> commitAsync() { final TransactionImple theTransaction = TransactionImple .getTransaction(); if (theTransaction == null) throw new IllegalStateException("BaseTransaction.commit - " + jtaLogger.i18NLogger.get_transaction_arjunacore_notx()); AtomicAction.suspend(); return wrap(new Callable<Void>() { public Void call() throws InvalidTransactionException, javax.transaction.RollbackException, javax.transaction.HeuristicMixedException, javax.transaction.HeuristicRollbackException, java.lang.SecurityException, javax.transaction.SystemException, java.lang.IllegalStateException { if (AtomicAction.suspend() != null) { System.err .println("WARNING - A PREVIOUS TRANSACTION WAS ON THE THREAD UNSUSPENDED"); } if (!AtomicAction.resume(theTransaction.getAtomicAction())) throw new InvalidTransactionException(); theTransaction.commitAndDisassociate(); return null; } }); }
public Void call() throws InvalidTransactionException, javax.transaction.RollbackException, javax.transaction.HeuristicMixedException, javax.transaction.HeuristicRollbackException, java.lang.SecurityException, javax.transaction.SystemException, java.lang.IllegalStateException { if (AtomicAction.suspend() != null) { System.err .println("WARNING - A PREVIOUS TRANSACTION WAS ON THE THREAD UNSUSPENDED"); } if (!AtomicAction.resume(theTransaction.getAtomicAction())) throw new InvalidTransactionException(); theTransaction.commitAndDisassociate(); return null; } });
public Void call() throws InvalidTransactionException, javax.transaction.RollbackException, javax.transaction.HeuristicMixedException, javax.transaction.HeuristicRollbackException, java.lang.SecurityException, javax.transaction.SystemException, java.lang.IllegalStateException { if (AtomicAction.suspend() != null) { System.err .println("WARNING - A PREVIOUS TRANSACTION WAS ON THE THREAD UNSUSPENDED"); } if (!AtomicAction.resume(theTransaction.getAtomicAction())) throw new InvalidTransactionException(); theTransaction.commitAndDisassociate(); return null; } });
public Void call() throws InvalidTransactionException, javax.transaction.RollbackException, javax.transaction.HeuristicMixedException, javax.transaction.HeuristicRollbackException, java.lang.SecurityException, javax.transaction.SystemException, java.lang.IllegalStateException { if (AtomicAction.suspend() != null) { System.err .println("WARNING - A PREVIOUS TRANSACTION WAS ON THE THREAD UNSUSPENDED"); } if (!AtomicAction.resume(theTransaction.getAtomicAction())) throw new InvalidTransactionException(); theTransaction.commitAndDisassociate(); return null; } });
public Void call() throws InvalidTransactionException, javax.transaction.RollbackException, javax.transaction.HeuristicMixedException, javax.transaction.HeuristicRollbackException, java.lang.SecurityException, javax.transaction.SystemException, java.lang.IllegalStateException { if (AtomicAction.suspend() != null) { System.err .println("WARNING - A PREVIOUS TRANSACTION WAS ON THE THREAD UNSUSPENDED"); } if (!AtomicAction.resume(theTransaction.getAtomicAction())) throw new InvalidTransactionException(); theTransaction.commitAndDisassociate(); return null; } });
public Void call() throws InvalidTransactionException, javax.transaction.RollbackException, javax.transaction.HeuristicMixedException, javax.transaction.HeuristicRollbackException, java.lang.SecurityException, javax.transaction.SystemException, java.lang.IllegalStateException { if (AtomicAction.suspend() != null) { System.err .println("WARNING - A PREVIOUS TRANSACTION WAS ON THE THREAD UNSUSPENDED"); } if (!AtomicAction.resume(theTransaction.getAtomicAction())) throw new InvalidTransactionException(); theTransaction.commitAndDisassociate(); return null; } });