Java 类org.hibernate.engine.transaction.spi.LocalStatus 实例源码

项目:lams    文件:JtaTransaction.java   
@Override
protected void doRollback() {
    try {
        if ( isInitiator ) {
            // failed commits automatically rollback the transaction per JTA spec
            if ( getLocalStatus() != LocalStatus.FAILED_COMMIT  ) {
                userTransaction.rollback();
                LOG.debug( "Rolled back JTA UserTransaction" );
            }
        }
        else {
            markRollbackOnly();
        }
    }
    catch ( Exception e ) {
        throw new TransactionException( "JTA rollback failed", e );
    }
}
项目:lams    文件:JtaTransaction.java   
@Override
public boolean isActive() throws HibernateException {
    if ( getLocalStatus() != LocalStatus.ACTIVE ) {
        return false;
    }

    final int status;
    try {
        status = userTransaction.getStatus();
    }
    catch ( SystemException se ) {
        throw new TransactionException( "Could not determine transaction status: ", se );
    }
    return JtaStatusHelper.isActive( status );
}
项目:eduqiservice    文件:GenericDAOImpl.java   
@Override
public Session getSession(){
    session = sessionFactory.getCurrentSession();
    if(session == null){
        this.session = sessionFactory.openSession();
        LOG.debug("Session opened");
    }
    if(session != null && !(session.getTransaction().getLocalStatus().equals(LocalStatus.ACTIVE))){
        session.beginTransaction();
        LOG.debug("Begining Transaction");
    }
    return this.session;
}
项目:lams    文件:JdbcTransaction.java   
@Override
public boolean isActive() throws HibernateException {
    return getLocalStatus() == LocalStatus.ACTIVE;
}
项目:lams    文件:Transaction.java   
/**
 * Get the current local status of this transaction.
 * <p/>
 * This only accounts for the local view of the transaction status.  In other words it does not check the status
 * of the actual underlying transaction.
 *
 * @return The current local status.
 */
public LocalStatus getLocalStatus();