本文整理汇总了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();
}
}
}
示例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);
}
}
示例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);
}
}
示例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();
}
示例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();
}
示例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);
}
}
示例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).
}
}
}
}
示例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);
}
示例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));
}
}
}
}
示例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);
}
}
示例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);
}
}
示例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();
}
示例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();
}
示例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();
}
示例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();
}