private boolean isTransactionInProgress(Transaction tx) throws SystemException { return JTAHelper.isTransactionInProgress(tx) && ! JTAHelper.isRollback( tx.getStatus() ); }
private boolean isJTATransactionInProgress(javax.transaction.Transaction tx) throws SystemException { return tx != null && JTAHelper.isInProgress( tx.getStatus() ); }
public boolean wasRolledBack() throws TransactionException { //if (!begun) return false; //if (commitFailed) return true; final int status; try { status = ut.getStatus(); } catch (SystemException se) { log.error("Could not determine transaction status", se); throw new TransactionException("Could not determine transaction status", se); } if (status==Status.STATUS_UNKNOWN) { throw new TransactionException("Could not determine transaction status"); } else { return JTAHelper.isRollback(status); } }
/** * Return true if a JTA transaction is in progress * and false in *every* other cases (including in a JDBC transaction). */ public static boolean isTransactionInProgress(SessionFactoryImplementor factory) { TransactionManager tm = factory.getTransactionManager(); try { return tm != null && isTransactionInProgress( tm.getTransaction() ); } catch (SystemException se) { throw new TransactionException( "could not obtain JTA Transaction", se ); } }
public boolean wasRolledBack() throws TransactionException { if (!begun) return false; final int status; try { status = transaction.getStatus(); } catch (SystemException se) { log.error("Could not determine transaction status", se); throw new TransactionException("Could not determine transaction status", se); } if (status==Status.STATUS_UNKNOWN) { throw new TransactionException("Could not determine transaction status"); } else { return JTAHelper.isRollback(status); } }
public Session getSession() { /** * Handle non transactional mode by requesting a temporary session to the session factory * This session, will aggressively use the AFTER_STATEMENT connection release mode to be * sure the conenctions are released. Be aware that the session will not be closed explicitly. */ Session s; SessionFactoryImplementor sfi = (SessionFactoryImplementor) sessionFactory; if ( !JTAHelper.isTransactionInProgress( sfi ) ) { s = sfi.openTemporarySession(); ( (SessionImplementor) s ).setAutoClear( true ); } else { s = sessionFactory.getCurrentSession(); } return s; }
public boolean wasRolledBack() throws TransactionException { if (!begun) return false; if (commitFailed) return true; final int status; try { status = ut.getStatus(); } catch (SystemException se) { log.error("Could not determine transaction status", se); throw new TransactionException("Could not determine transaction status", se); } if (status==Status.STATUS_UNKNOWN) { throw new TransactionException("Could not determine transaction status"); } else { return JTAHelper.isRollback(status); } }
private boolean isTransactionInProgress(Transaction tx) throws SystemException { return JTAHelper.isTransactionInProgress(tx) && ! JTAHelper.isRollback( tx.getStatus() ); }
public Session getSession() { /** * Handle non transactional mode by requesting a temporary session to the session factory * This session, will aggressively use the AFTER_STATEMENT connection release mode to be * sure the conenctions are released. Be aware that the session will not be closed explicitly. */ Session s; SessionFactoryImplementor sfi = (SessionFactoryImplementor) sessionFactory; if ( !JTAHelper.isTransactionInProgress( sfi ) ) { s = sfi.openTemporarySession(); ( (SessionImplementor) s ).setAutoClear( true ); } else { s = sessionFactory.getCurrentSession(); } return s; }
public static boolean isTransactionInProgress(javax.transaction.Transaction tx) throws SystemException { return tx != null && JTAHelper.isInProgress( tx.getStatus() ); }
public boolean wasRolledBack() throws TransactionException { if (!begun) return false; final int status; try { status = getTransaction().getStatus(); } catch (SystemException se) { log.error("Could not determine transaction status", se); throw new TransactionException("Could not determine transaction status", se); } if (status==Status.STATUS_UNKNOWN) { throw new TransactionException("Could not determine transaction status"); } else { return JTAHelper.isRollback(status); } }
public boolean isTransactionInProgress( JDBCContext jdbcContext, TransactionFactory.Context transactionContext ) { try { return status == JoinStatus.JOINED && isTransactionInProgress( transactionContext.getFactory().getTransactionManager().getTransaction() ); } catch (SystemException se) { throw new TransactionException( "Unable to check transaction status", se ); } }
UserTransaction ut = ( ( JTATransaction ) transaction ).getUserTransaction(); if ( ut != null ) { return JTAHelper.isInProgress( ut.getStatus() ); return JTAHelper.isInProgress( jdbcContext.getFactory().getTransactionManager().getStatus() ); return ut != null && JTAHelper.isInProgress( ut.getStatus() );
public void beforeCompletion() { log.trace("transaction before completion callback"); boolean flush; try { flush = !ctx.isFlushModeNever() && ctx.isFlushBeforeCompletionEnabled() && !JTAHelper.isRollback( transaction.getStatus() ); //actually, this last test is probably unnecessary, since //beforeCompletion() doesn't get called during rollback } catch (SystemException se) { log.error("could not determine transaction status", se); throw new TransactionException("could not determine transaction status in beforeCompletion()", se); } try { if (flush) { log.trace("automatically flushing session"); ctx.managedFlush(); } } finally { jdbcContext.beforeTransactionCompletion(hibernateTransaction); } }
public boolean isTransactionInProgress( JDBCContext jdbcContext, Context transactionContext, Transaction transaction) { try { return JTAHelper.isTransactionInProgress( transactionContext.getFactory().getTransactionManager().getTransaction() ); } catch( SystemException se ) { throw new TransactionException( "Unable to check transaction status", se ); } }
throw new HibernateException( "Unable to locate current JTA transaction" ); if ( !JTAHelper.isInProgress( txn.getStatus() ) ) {
( transaction == null || !JTAHelper.isRollback( transaction.getStatus() ) );
throw new HibernateException( "Unable to locate current JTA transaction" ); if ( !JTAHelper.isInProgress( txn.getStatus() ) ) {
public void beforeCompletion() { log.trace("transaction before completion callback"); boolean flush; try { flush = !ctx.isFlushModeNever() && ctx.isFlushBeforeCompletionEnabled() && !JTAHelper.isRollback( transaction.getStatus() ); //actually, this last test is probably unnecessary, since //beforeCompletion() doesn't get called during rollback } catch (SystemException se) { log.error("could not determine transaction status", se); setRollbackOnly(); throw new TransactionException("could not determine transaction status in beforeCompletion()", se); } try { if (flush) { log.trace("automatically flushing session"); ctx.managedFlush(); } } catch (RuntimeException re) { setRollbackOnly(); throw re; } finally { jdbcContext.beforeTransactionCompletion(hibernateTransaction); } }
( transaction == null || !JTAHelper.isRollback( transaction.getStatus() ) );