@Override public int getStatus() throws SystemException { return this.transactionManager.getStatus(); }
@Override public int getCurrentStatus() throws SystemException { return this.transactionManager.getStatus(); }
@Override public int getStatus() throws SystemException { return this.transactionManager.getStatus(); }
/** {@inheritDoc} */ @Override public int getStatus() throws SystemException { return mgr.getStatus(); }
/** * Calls getStatus() of the transaction manager owning this user transaction * * @see javax.transaction.UserTransaction#getStatus() */ @Override public int getStatus() throws SystemException { return tm.getStatus(); }
@Override public int getStatus() throws SystemException { return this.transactionManager.getStatus(); }
@Override public boolean canRegisterSynchronization() { try { return (this.transactionManager.getStatus() == Status.STATUS_ACTIVE); } catch (SystemException ex) { throw new TransactionException("Could not determine JTA transaction status", ex); } }
@SneakyThrows @Override public boolean isInTransaction() { return Status.STATUS_NO_TRANSACTION != xaTransactionManager.getTransactionManager().getStatus(); }
private boolean isExisting() { try { return transactionManager.getStatus() != Status.STATUS_NO_TRANSACTION; } catch (SystemException e) { throw new TransactionException("Unable to retrieve transaction status", e); } }
@Override public int getCurrentStatus() throws SystemException { return retrieveTransactionManager().getStatus(); } }
@Override public int getCurrentStatus() throws SystemException { return retrieveTransactionManager().getStatus(); }
public int getCurrentStatus() throws SystemException { return retrieveTransactionManager().getStatus(); }
@Override public boolean canRegisterSynchronization() { try { return (this.transactionManager.getStatus() == Status.STATUS_ACTIVE); } catch (SystemException ex) { throw new TransactionException("Could not determine JTA transaction status", ex); } }
protected boolean calledInsideTransaction() { try { return transactionManager.getStatus() != Status.STATUS_NO_TRANSACTION; } catch (SystemException e) { throw new ActivitiException("Could not determine the current status of the transaction manager: " + e.getMessage(), e); } }
public static void tryCommit(TransactionManager tm) throws Exception { if ( tm.getStatus() == Status.STATUS_MARKED_ROLLBACK ) { tm.rollback(); } else { tm.commit(); } } }
@Override public TransactionStatus getStatus() { try { return StatusTranslator.translate( transactionManager.getStatus() ); } catch (SystemException e) { throw new TransactionException( "JTA TransactionManager#getStatus failed", e ); } }
/** * Used by envers... */ public static void tryCommit() throws Exception { if ( transactionManager().getStatus() == Status.STATUS_MARKED_ROLLBACK ) { transactionManager().rollback(); } else { transactionManager().commit(); } }
public void reset() throws SystemException { if ( transactionManager != null ) { if ( transactionManager.getStatus() != Status.STATUS_NO_TRANSACTION ) { transactionManager.rollback(); } } if ( userTransaction != null ) { if ( userTransaction.getStatus() != Status.STATUS_NO_TRANSACTION ) { userTransaction.rollback(); } } }
@Test @SuppressWarnings("EmptyCatchBlock") public void explicitJoinOutsideTxnTest() throws Exception { // pre conditions final TransactionManager tm = JtaPlatformStandardTestingImpl.INSTANCE.transactionManager(); assertEquals( Status.STATUS_NO_TRANSACTION, tm.getStatus() ); final JtaTransactionCoordinatorImpl transactionCoordinator = buildTransactionCoordinator( false ); assertEquals( Status.STATUS_NO_TRANSACTION, tm.getStatus() ); // try to force a join, should fail... try { transactionCoordinator.explicitJoin(); fail( "Expecting explicitJoin() call outside of transaction to fail" ); } catch (TransactionRequiredForJoinException expected) { } }
@Test public void jtaTransactionManagerWithPropagationRequiresNewAndAdapter() throws Exception { TransactionManager tm = mock(TransactionManager.class); Transaction tx = mock(Transaction.class); given(tm.getStatus()).willReturn(Status.STATUS_ACTIVE); given(tm.suspend()).willReturn(tx); JtaTransactionManager ptm = newJtaTransactionManager(tm); TransactionTemplate tt = new TransactionTemplate(ptm); tt.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW); assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); tt.execute(new TransactionCallbackWithoutResult() { @Override protected void doInTransactionWithoutResult(TransactionStatus status) { assertTrue(TransactionSynchronizationManager.isSynchronizationActive()); } }); assertFalse(TransactionSynchronizationManager.isSynchronizationActive()); verify(tm).begin(); verify(tm).commit(); verify(tm).resume(tx); }