当前位置: 首页>>代码示例>>Java>>正文


Java LocalStatus类代码示例

本文整理汇总了Java中org.hibernate.engine.transaction.spi.LocalStatus的典型用法代码示例。如果您正苦于以下问题:Java LocalStatus类的具体用法?Java LocalStatus怎么用?Java LocalStatus使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LocalStatus类属于org.hibernate.engine.transaction.spi包,在下文中一共展示了LocalStatus类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doRollback

import org.hibernate.engine.transaction.spi.LocalStatus; //导入依赖的package包/类
@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 );
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:19,代码来源:JtaTransaction.java

示例2: isActive

import org.hibernate.engine.transaction.spi.LocalStatus; //导入依赖的package包/类
@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 );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:16,代码来源:JtaTransaction.java

示例3: getSession

import org.hibernate.engine.transaction.spi.LocalStatus; //导入依赖的package包/类
@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;
}
 
开发者ID:samuelyuri,项目名称:eduqiservice,代码行数:14,代码来源:GenericDAOImpl.java

示例4: isActive

import org.hibernate.engine.transaction.spi.LocalStatus; //导入依赖的package包/类
@Override
public boolean isActive() throws HibernateException {
	return getLocalStatus() == LocalStatus.ACTIVE;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:5,代码来源:JdbcTransaction.java

示例5: getLocalStatus

import org.hibernate.engine.transaction.spi.LocalStatus; //导入依赖的package包/类
/**
 * 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();
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:Transaction.java


注:本文中的org.hibernate.engine.transaction.spi.LocalStatus类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。