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


Java DefaultTransactionStatus.isDebug方法代码示例

本文整理汇总了Java中org.springframework.transaction.support.DefaultTransactionStatus.isDebug方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultTransactionStatus.isDebug方法的具体用法?Java DefaultTransactionStatus.isDebug怎么用?Java DefaultTransactionStatus.isDebug使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.transaction.support.DefaultTransactionStatus的用法示例。


在下文中一共展示了DefaultTransactionStatus.isDebug方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doRollback

import org.springframework.transaction.support.DefaultTransactionStatus; //导入方法依赖的package包/类
@Override
protected void doRollback(DefaultTransactionStatus status) {
	JpaTransactionObject txObject = (JpaTransactionObject) status.getTransaction();
	if (status.isDebug()) {
		logger.debug("Rolling back JPA transaction on EntityManager [" +
				txObject.getEntityManagerHolder().getEntityManager() + "]");
	}
	try {
		EntityTransaction tx = txObject.getEntityManagerHolder().getEntityManager().getTransaction();
		if (tx.isActive()) {
			tx.rollback();
		}
	}
	catch (PersistenceException ex) {
		throw new TransactionSystemException("Could not roll back JPA transaction", ex);
	}
	finally {
		if (!txObject.isNewEntityManagerHolder()) {
			// Clear all pending inserts/updates/deletes in the EntityManager.
			// Necessary for pre-bound EntityManagers, to avoid inconsistent state.
			txObject.getEntityManagerHolder().getEntityManager().clear();
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:25,代码来源:JpaTransactionManager.java

示例2: doCommit

import org.springframework.transaction.support.DefaultTransactionStatus; //导入方法依赖的package包/类
@Override
protected void doCommit(DefaultTransactionStatus status) {
	JdoTransactionObject txObject = (JdoTransactionObject) status.getTransaction();
	if (status.isDebug()) {
		logger.debug("Committing JDO transaction on PersistenceManager [" +
				txObject.getPersistenceManagerHolder().getPersistenceManager() + "]");
	}
	try {
		Transaction tx = txObject.getPersistenceManagerHolder().getPersistenceManager().currentTransaction();
		tx.commit();
	}
	catch (JDOException ex) {
		// Assumably failed to flush changes to database.
		throw convertJdoAccessException(ex);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:JdoTransactionManager.java

示例3: doRollback

import org.springframework.transaction.support.DefaultTransactionStatus; //导入方法依赖的package包/类
@Override
protected void doRollback(DefaultTransactionStatus status) {
	JdoTransactionObject txObject = (JdoTransactionObject) status.getTransaction();
	if (status.isDebug()) {
		logger.debug("Rolling back JDO transaction on PersistenceManager [" +
				txObject.getPersistenceManagerHolder().getPersistenceManager() + "]");
	}
	try {
		Transaction tx = txObject.getPersistenceManagerHolder().getPersistenceManager().currentTransaction();
		if (tx.isActive()) {
			tx.rollback();
		}
	}
	catch (JDOException ex) {
		throw new TransactionSystemException("Could not roll back JDO transaction", ex);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:18,代码来源:JdoTransactionManager.java

示例4: doCommit

import org.springframework.transaction.support.DefaultTransactionStatus; //导入方法依赖的package包/类
@Override
protected void doCommit(DefaultTransactionStatus status) {
	DataSourceTransactionObject txObject = (DataSourceTransactionObject) status.getTransaction();
	Connection con = txObject.getConnectionHolder().getConnection();
	if (status.isDebug()) {
		logger.debug("Committing JDBC transaction on Connection [" + con + "]");
	}
	try {
		con.commit();
	}
	catch (SQLException ex) {
		throw new TransactionSystemException("Could not commit JDBC transaction", ex);
	}
	
	/**modify by guosg 这里提交ldtm事务*/
	SynchronizationManager.getCurrentUserTransation().commit();
}
 
开发者ID:gsgsdtc,项目名称:ldtm,代码行数:18,代码来源:LdtmDataSourceTransactionManager.java

示例5: doRollback

import org.springframework.transaction.support.DefaultTransactionStatus; //导入方法依赖的package包/类
@Override
protected void doRollback(DefaultTransactionStatus status) {
	DataSourceTransactionObject txObject = (DataSourceTransactionObject) status.getTransaction();
	Connection con = txObject.getConnectionHolder().getConnection();
	if (status.isDebug()) {
		logger.debug("Rolling back JDBC transaction on Connection [" + con + "]");
	}
	try {
		con.rollback();
	}
	catch (SQLException ex) {
		throw new TransactionSystemException("Could not roll back JDBC transaction", ex);
	}
	
	/**modify by guosg 这里提交回滚事务*/
	SynchronizationManager.getCurrentUserTransation().rollback();
}
 
开发者ID:gsgsdtc,项目名称:ldtm,代码行数:18,代码来源:LdtmDataSourceTransactionManager.java

示例6: doCommit

import org.springframework.transaction.support.DefaultTransactionStatus; //导入方法依赖的package包/类
@Override
protected void doCommit(DefaultTransactionStatus status) {
	JcrTransactionObject txObject = (JcrTransactionObject) status
			.getTransaction();
	if (status.isDebug()) {
		LOG.debug("Committing JCR transaction on session ["
				+ txObject.getSessionHolder().getSession() + "]");
	}
	try {
		txObject.getSessionHolder().getTransaction().commit();
	} catch (Exception ex) {
		// assumably from commit call to the underlying JCR repository
		throw new TransactionSystemException(
				"Could not commit JCR transaction", ex);
	}
}
 
开发者ID:MyCollab,项目名称:mycollab,代码行数:17,代码来源:LocalTransactionManager.java

示例7: doRollback

import org.springframework.transaction.support.DefaultTransactionStatus; //导入方法依赖的package包/类
@Override
protected void doRollback(DefaultTransactionStatus status) {
	JcrTransactionObject txObject = (JcrTransactionObject) status
			.getTransaction();
	if (status.isDebug()) {
		LOG.debug("Rolling back JCR transaction on session ["
				+ txObject.getSessionHolder().getSession() + "]");
	}
	try {
		txObject.getSessionHolder().getTransaction().rollback();
	} catch (Exception ex) {
		throw new TransactionSystemException(
				"Could not roll back JCR transaction", ex);
	} finally {
		if (!txObject.isNewSessionHolder()) {
			// Clear all pending inserts/updates/deletes in the Session.
			// Necessary for pre-bound Sessions, to avoid inconsistent
			// state.
			try {
				txObject.getSessionHolder().getSession().refresh(false);
			} catch (RepositoryException e) {
				// we already throw an exception (hold back this one).
			}
		}
	}
}
 
开发者ID:MyCollab,项目名称:mycollab,代码行数:27,代码来源:LocalTransactionManager.java

示例8: doRollback

import org.springframework.transaction.support.DefaultTransactionStatus; //导入方法依赖的package包/类
@Override
protected void doRollback(DefaultTransactionStatus status)
{
	MolgenisTransaction transaction = (MolgenisTransaction) status.getTransaction();
	if (LOG.isDebugEnabled())
	{
		LOG.debug("Rollback transaction [{}]", transaction.getId());
	}

	DefaultTransactionStatus jpaTransactionStatus = new DefaultTransactionStatus(
			transaction.getDataSourceTransaction(), status.isNewTransaction(), status.isNewSynchronization(),
			status.isReadOnly(), status.isDebug(), status.getSuspendedResources());

	if (!status.isReadOnly())
	{
		transactionListeners.forEach(j -> j.rollbackTransaction(transaction.getId()));
	}

	super.doRollback(jpaTransactionStatus);
}
 
开发者ID:molgenis,项目名称:molgenis,代码行数:21,代码来源:PostgreSqlTransactionManager.java

示例9: run

import org.springframework.transaction.support.DefaultTransactionStatus; //导入方法依赖的package包/类
@Override
public void run() {
	DefaultTransactionStatus status = prepareTransactionStatus(
			this.definition, (this.actualTransaction ? this : null),
			this.newTransaction, this.newSynchronization, this.debug, null);
	try {
		this.result = this.callback.doInTransaction(status);
		triggerBeforeCommit(status);
	}
	catch (Throwable ex) {
		this.exception = ex;
		uowManager.setRollbackOnly();
	}
	finally {
		if (status.isLocalRollbackOnly()) {
			if (status.isDebug()) {
				logger.debug("Transactional code has requested rollback");
			}
			uowManager.setRollbackOnly();
		}
		triggerBeforeCompletion(status);
		if (status.isNewSynchronization()) {
			List<TransactionSynchronization> synchronizations = TransactionSynchronizationManager.getSynchronizations();
			TransactionSynchronizationManager.clear();
			if (!synchronizations.isEmpty()) {
				uowManager.registerInterposedSynchronization(new JtaAfterCompletionSynchronization(synchronizations));
			}
		}
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:31,代码来源:WebSphereUowTransactionManager.java

示例10: doCommit

import org.springframework.transaction.support.DefaultTransactionStatus; //导入方法依赖的package包/类
@Override
protected void doCommit(DefaultTransactionStatus status) {
	DataSourceTransactionObject txObject = (DataSourceTransactionObject) status.getTransaction();
	Connection con = txObject.getConnectionHolder().getConnection();
	if (status.isDebug()) {
		logger.debug("Committing JDBC transaction on Connection [" + con + "]");
	}
	try {
		con.commit();
	}
	catch (SQLException ex) {
		throw new TransactionSystemException("Could not commit JDBC transaction", ex);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:DataSourceTransactionManager.java

示例11: doRollback

import org.springframework.transaction.support.DefaultTransactionStatus; //导入方法依赖的package包/类
@Override
protected void doRollback(DefaultTransactionStatus status) {
	DataSourceTransactionObject txObject = (DataSourceTransactionObject) status.getTransaction();
	Connection con = txObject.getConnectionHolder().getConnection();
	if (status.isDebug()) {
		logger.debug("Rolling back JDBC transaction on Connection [" + con + "]");
	}
	try {
		con.rollback();
	}
	catch (SQLException ex) {
		throw new TransactionSystemException("Could not roll back JDBC transaction", ex);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:15,代码来源:DataSourceTransactionManager.java

示例12: doSetRollbackOnly

import org.springframework.transaction.support.DefaultTransactionStatus; //导入方法依赖的package包/类
@Override
protected void doSetRollbackOnly(DefaultTransactionStatus status) {
	DataSourceTransactionObject txObject = (DataSourceTransactionObject) status.getTransaction();
	if (status.isDebug()) {
		logger.debug("Setting JDBC transaction [" + txObject.getConnectionHolder().getConnection() +
				"] rollback-only");
	}
	txObject.setRollbackOnly();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:DataSourceTransactionManager.java

示例13: doSetRollbackOnly

import org.springframework.transaction.support.DefaultTransactionStatus; //导入方法依赖的package包/类
@Override
protected void doSetRollbackOnly(DefaultTransactionStatus status) {
	CciLocalTransactionObject txObject = (CciLocalTransactionObject) status.getTransaction();
	if (status.isDebug()) {
		logger.debug("Setting CCI local transaction [" + txObject.getConnectionHolder().getConnection() +
				"] rollback-only");
	}
	txObject.getConnectionHolder().setRollbackOnly();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:CciLocalTransactionManager.java

示例14: doSetRollbackOnly

import org.springframework.transaction.support.DefaultTransactionStatus; //导入方法依赖的package包/类
@Override
protected void doSetRollbackOnly(DefaultTransactionStatus status) {
	JpaTransactionObject txObject = (JpaTransactionObject) status.getTransaction();
	if (status.isDebug()) {
		logger.debug("Setting JPA transaction on EntityManager [" +
				txObject.getEntityManagerHolder().getEntityManager() + "] rollback-only");
	}
	txObject.setRollbackOnly();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:JpaTransactionManager.java

示例15: doSetRollbackOnly

import org.springframework.transaction.support.DefaultTransactionStatus; //导入方法依赖的package包/类
@Override
protected void doSetRollbackOnly(DefaultTransactionStatus status) {
	JdoTransactionObject txObject = (JdoTransactionObject) status.getTransaction();
	if (status.isDebug()) {
		logger.debug("Setting JDO transaction on PersistenceManager [" +
				txObject.getPersistenceManagerHolder().getPersistenceManager() + "] rollback-only");
	}
	txObject.setRollbackOnly();
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:10,代码来源:JdoTransactionManager.java


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