public void resume(Transaction tx) throws IllegalStateException, InvalidTransactionException, SystemException { if (getTransaction() != null && tx != getTransaction()) { throw new IllegalStateException("Thread already associated with another transaction"); } if (tx != null && tx != getTransaction()) { if (!(tx instanceof TransactionImpl)) { throw new InvalidTransactionException("Cannot resume foreign transaction: " + tx); } associate((TransactionImpl) tx); } }
public void resume(Transaction tx) throws IllegalStateException, InvalidTransactionException, SystemException { if (getTransaction() != null && tx != getTransaction()) { throw new IllegalStateException("Thread already associated with another transaction"); } if (tx != null && tx != getTransaction()) { if (!(tx instanceof TransactionImpl)) { throw new InvalidTransactionException("Cannot resume foreign transaction: " + tx); } associate((TransactionImpl) tx); } }
public void resume(Transaction tx) throws IllegalStateException, InvalidTransactionException, SystemException { if (getTransaction() != null && tx != getTransaction()) { throw new IllegalStateException("Thread already associated with another transaction"); } if (tx != null && tx != getTransaction()) { if (!(tx instanceof TransactionImpl)) { throw new InvalidTransactionException("Cannot resume foreign transaction: " + tx); } associate((TransactionImpl) tx); } }
public Transaction suspend() throws SystemException { Transaction tx = getTransaction(); if (tx != null) { unassociate(); } return tx; }
public int getStatus() throws SystemException { Transaction tx = getTransaction(); return (tx != null) ? tx.getStatus() : Status.STATUS_NO_TRANSACTION; }
public Transaction suspend() throws SystemException { Transaction tx = getTransaction(); if (tx != null) { unassociate(); } return tx; }
public int getTransactionStatus() { TransactionImpl tx = (TransactionImpl) getTransaction(); return tx == null? Status.STATUS_NO_TRANSACTION: tx.getTransactionStatus(); }
public Transaction suspend() throws SystemException { Transaction tx = getTransaction(); if (tx != null) { unassociate(); } return tx; }
public Object getTransactionKey() { TransactionImpl tx = (TransactionImpl) getTransaction(); return tx == null ? null: tx.getTransactionKey(); }
public InternalCMPEntityManagerExtended(EntityManager entityManager, String persistenceUnit, TransactionManagerImpl transactionManager) { this.entityManager = entityManager; this.persistenceUnit = persistenceUnit; this.transactionManager = transactionManager; if (transactionManager.getTransaction() != null) { joinTransaction(); } }
public void rollback() throws IllegalStateException, SecurityException, SystemException { Transaction tx = getTransaction(); if (tx == null) { throw new IllegalStateException("No transaction associated with current thread"); } try { tx.rollback(); } finally { unassociate(); } totalRollBacks.getAndIncrement(); }
public void commit() throws HeuristicMixedException, HeuristicRollbackException, IllegalStateException, RollbackException, SecurityException, SystemException { Transaction tx = getTransaction(); if (tx == null) { throw new IllegalStateException("No transaction associated with current thread"); } try { tx.commit(); } finally { unassociate(); } totalCommits.getAndIncrement(); }
private void unassociate() { Transaction tx = getTransaction(); if (tx != null) { associatedTransactions.remove(tx); threadTx.set(null); fireThreadUnassociated(tx); activeCount.getAndDecrement(); } }
public void commit() throws HeuristicMixedException, HeuristicRollbackException, IllegalStateException, RollbackException, SecurityException, SystemException { Transaction tx = getTransaction(); if (tx == null) { throw new IllegalStateException("No transaction associated with current thread"); } try { tx.commit(); } finally { unassociate(); } totalCommits.getAndIncrement(); }
public void commit() throws HeuristicMixedException, HeuristicRollbackException, IllegalStateException, RollbackException, SecurityException, SystemException { Transaction tx = getTransaction(); if (tx == null) { throw new IllegalStateException("No transaction associated with current thread"); } try { tx.commit(); } finally { unassociate(); } totalCommits.getAndIncrement(); }
public void rollback() throws IllegalStateException, SecurityException, SystemException { Transaction tx = getTransaction(); if (tx == null) { throw new IllegalStateException("No transaction associated with current thread"); } try { tx.rollback(); } finally { unassociate(); } totalRollBacks.getAndIncrement(); }
private void unassociate() { Transaction tx = getTransaction(); if (tx != null) { associatedTransactions.remove(tx); threadTx.set(null); fireThreadUnassociated(tx); activeCount.getAndDecrement(); } }
public void commit() throws HeuristicMixedException, HeuristicRollbackException, IllegalStateException, RollbackException, SecurityException, SystemException { Transaction tx = getTransaction(); if (tx == null) { throw new IllegalStateException("No transaction associated with current thread"); } try { tx.commit(); } finally { unassociate(); } totalCommits.getAndIncrement(); }
public void rollback() throws IllegalStateException, SecurityException, SystemException { Transaction tx = getTransaction(); if (tx == null) { throw new IllegalStateException("No transaction associated with current thread"); } try { tx.rollback(); } finally { unassociate(); } totalRollBacks.getAndIncrement(); }
private void unassociate() { Transaction tx = getTransaction(); if (tx != null) { associatedTransactions.remove(tx); threadTx.set(null); fireThreadUnassociated(tx); activeCount.getAndDecrement(); } }