本文整理了Java中org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback()
方法的一些代码示例,展示了AbstractPlatformTransactionManager.rollback()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。AbstractPlatformTransactionManager.rollback()
方法的具体详情如下:
包路径:org.springframework.transaction.support.AbstractPlatformTransactionManager
类名称:AbstractPlatformTransactionManager
方法名:rollback
[英]This implementation of rollback handles participating in existing transactions. Delegates to doRollback and doSetRollbackOnly.
[中]
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools
public void rollback(boolean transactionOwner) {
try {
if ( transactionOwner ) {
this.ptm.rollback( currentTransaction );
currentTransaction = null;
}
} catch ( Exception e ) {
logger.warn( "Unable to rollback transaction",
e );
throw new RuntimeException( "Unable to rollback transaction",
e );
}
}
代码示例来源:origin: org.drools/drools-spring-legacy5
public void rollback(boolean transactionOwner) {
try {
if ( transactionOwner ) {
this.ptm.rollback( currentTransaction );
currentTransaction = null;
}
} catch ( Exception e ) {
logger.warn( "Unable to rollback transaction",
e );
throw new RuntimeException( "Unable to rollback transaction",
e );
}
}
代码示例来源:origin: org.drools/drools-spring
public void rollback(boolean transactionOwner) {
try {
if ( transactionOwner ) {
this.ptm.rollback( currentTransaction );
currentTransaction = null;
}
} catch ( Exception e ) {
logger.warn( "Unable to rollback transaction",
e );
throw new RuntimeException( "Unable to rollback transaction",
e );
}
}
代码示例来源:origin: kiegroup/droolsjbpm-integration
public void rollback(boolean transactionOwner) {
if (nestedTransactions || transactionOwner) {
try {
this.ptm.rollback(currentTransaction.pop());
} catch (Exception e) {
logger.warn("Unable to rollback transaction",
e);
throw new RuntimeException("Unable to rollback transaction",
e);
}
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.drools
public void rollback(boolean transactionOwner) {
if ( nestedTransactions || transactionOwner ) {
try {
this.ptm.rollback( currentTransaction.pop() );
} catch ( Exception e ) {
logger.warn( "Unable to rollback transaction",
e );
throw new RuntimeException( "Unable to rollback transaction",
e );
}
}
}
代码示例来源:origin: org.drools/drools-spring
public void rollback(boolean transactionOwner) {
if ( nestedTransactions || transactionOwner ) {
try {
this.ptm.rollback( currentTransaction.pop() );
} catch ( Exception e ) {
logger.warn( "Unable to rollback transaction",
e );
throw new RuntimeException( "Unable to rollback transaction",
e );
}
}
}
代码示例来源:origin: org.drools/drools-spring-legacy5
public void rollback(boolean transactionOwner) {
if ( nestedTransactions || transactionOwner ) {
try {
this.ptm.rollback( currentTransaction.pop() );
} catch ( Exception e ) {
logger.warn( "Unable to rollback transaction",
e );
throw new RuntimeException( "Unable to rollback transaction",
e );
}
}
}
代码示例来源:origin: org.kie/kie-spring
public void rollback(boolean transactionOwner) {
if (nestedTransactions || transactionOwner) {
try {
this.ptm.rollback(currentTransaction.pop());
} catch (Exception e) {
logger.warn("Unable to rollback transaction",
e);
throw new RuntimeException("Unable to rollback transaction",
e);
}
}
}
代码示例来源:origin: kiegroup/droolsjbpm-integration
public void rollback(boolean transactionOwner) {
try {
if (transactionOwner) {
this.ptm.rollback(currentTransaction);
currentTransaction = null;
if (TransactionSynchronizationManager.hasResource(KieSpringTransactionManager.RESOURCE_CONTAINER)) {
TransactionSynchronizationManager.unbindResource(KieSpringTransactionManager.RESOURCE_CONTAINER);
}
}
} catch (Exception e) {
logger.warn("Unable to rollback transaction",
e);
throw new RuntimeException("Unable to rollback transaction",
e);
}
}
代码示例来源:origin: org.kie/kie-spring
public void rollback(boolean transactionOwner) {
try {
if (transactionOwner) {
this.ptm.rollback(currentTransaction);
currentTransaction = null;
if (TransactionSynchronizationManager.hasResource(KieSpringTransactionManager.RESOURCE_CONTAINER)) {
TransactionSynchronizationManager.unbindResource(KieSpringTransactionManager.RESOURCE_CONTAINER);
}
}
} catch (Exception e) {
logger.warn("Unable to rollback transaction",
e);
throw new RuntimeException("Unable to rollback transaction",
e);
}
}
代码示例来源:origin: kiegroup/droolsjbpm-integration
@Override
public
TransactionStatus status = transactionManager.getTransaction(defTransDefinition);
try {
T result = super.execute(command);
transactionManager.commit(status);
return result;
} catch (Throwable e) {
transactionManager.rollback(status);
throw new RuntimeException(e);
}
}
代码示例来源:origin: org.kie/kie-spring
@Override
public
TransactionStatus status = transactionManager.getTransaction(defTransDefinition);
try {
T result = super.execute(command);
transactionManager.commit(status);
return result;
} catch (Throwable e) {
transactionManager.rollback(status);
throw new RuntimeException(e);
}
}
代码示例来源:origin: kiegroup/droolsjbpm-integration
@Test
public void testSimpleTaskInvocationWithRollback() throws Exception{
AbstractPlatformTransactionManager transactiOnManager= getTransactionManager();
RuntimeManager manager = getManager();
RuntimeEngine engine = getEngine();
KieSession ksession = getKieSession();
AuditLogService logService = getLogService();
DefaultTransactionDefinition def = new DefaultTransactionDefinition();
TransactionStatus status = transactionManager.getTransaction(def);
ProcessInstance processInstance = ksession.startProcess(SAMPLE_HELLO_PROCESS_ID);
long processInstanceId = processInstance.getId();
transactionManager.rollback(status);
processInstance = ksession.getProcessInstance(processInstanceId);
assertNull("Process instance not rolled back", processInstance);
System.out.println("Process instance rolled back");
List
System.out.println("Found " + tasks.size() + " task(s) for user '"+USER_JOHN+"'");
assertEquals(0, tasks.size());
ProcessInstanceLog log = logService.findProcessInstance(processInstanceId);
assertNull(log);
manager.disposeRuntimeEngine(engine);
}
}
代码示例来源:origin: org.kie/kie-spring
@Test
public void testSimpleTaskInvocationWithRollback() throws Exception{
AbstractPlatformTransactionManager transactiOnManager= getTransactionManager();
RuntimeManager manager = getManager();
RuntimeEngine engine = getEngine();
KieSession ksession = getKieSession();
AuditLogService logService = getLogService();
DefaultTransactionDefinition def = new DefaultTransactionDefinition();
TransactionStatus status = transactionManager.getTransaction(def);
ProcessInstance processInstance = ksession.startProcess(SAMPLE_HELLO_PROCESS_ID);
long processInstanceId = processInstance.getId();
transactionManager.rollback(status);
processInstance = ksession.getProcessInstance(processInstanceId);
assertNull("Process instance not rolled back", processInstance);
System.out.println("Process instance rolled back");
List
System.out.println("Found " + tasks.size() + " task(s) for user '"+USER_JOHN+"'");
assertEquals(0, tasks.size());
ProcessInstanceLog log = logService.findProcessInstance(processInstanceId);
assertNull(log);
manager.disposeRuntimeEngine(engine);
}
}