public void afterCompletion(int status) { if (this.service.txm != null) { ObjectMarshallingStrategy[] strategies = (ObjectMarshallingStrategy[]) this.service.environment.get(EnvironmentName.OBJECT_MARSHALLING_STRATEGIES); if (strategies != null) { for (ObjectMarshallingStrategy strategy : strategies) { if (strategy instanceof TransactionAware) { ((TransactionAware) strategy).onEnd(this.service.txm); } } } } this.service.tpm.endCommandScopedEntityManager(); }
for (ObjectMarshallingStrategy strategy : strategies) { if (strategy instanceof TransactionAware) { ((TransactionAware) strategy).onStart(txm);
private void registerRollbackSync() { if (txm != null) { ObjectMarshallingStrategy[] strategies = (ObjectMarshallingStrategy[]) env.get(EnvironmentName.OBJECT_MARSHALLING_STRATEGIES); for (ObjectMarshallingStrategy strategy : strategies) { if (strategy instanceof TransactionAware) { ((TransactionAware) strategy).onStart(txm); } } } TransactionManagerHelper.registerTransactionSyncInContainer(this.txm, new SynchronizationImpl( this )); }
public void afterCompletion(int status) { if (this.service.txm != null) { ObjectMarshallingStrategy[] strategies = (ObjectMarshallingStrategy[]) this.service.environment.get(EnvironmentName.OBJECT_MARSHALLING_STRATEGIES); if (strategies != null) { for (ObjectMarshallingStrategy strategy : strategies) { if (strategy instanceof TransactionAware) { ((TransactionAware) strategy).onEnd(this.service.txm); } } } } this.service.tpm.endCommandScopedEntityManager(); }
for (ObjectMarshallingStrategy strategy : strategies) { if (strategy instanceof TransactionAware) { ((TransactionAware) strategy).onStart(txm);
public void afterCompletion(int status) { if ( status != TransactionManager.STATUS_COMMITTED ) { this.service.rollback(); } if (this.service.txm != null) { ObjectMarshallingStrategy[] strategies = (ObjectMarshallingStrategy[]) this.service.env.get(EnvironmentName.OBJECT_MARSHALLING_STRATEGIES); for (ObjectMarshallingStrategy strategy : strategies) { if (strategy instanceof TransactionAware) { ((TransactionAware) strategy).onEnd(this.service.txm); } } } this.service.jpm.endCommandScopedEntityManager(); KieSession ksession = this.service.ksession; // clean up cached process and work item instances if ( ksession != null ) { InternalProcessRuntime internalProcessRuntime = ((InternalWorkingMemory) ksession).internalGetProcessRuntime(); if ( internalProcessRuntime != null ) { if (this.service.doRollback) { internalProcessRuntime.clearProcessInstancesState(); } internalProcessRuntime.clearProcessInstances(); } ((JPAWorkItemManager) ksession.getWorkItemManager()).clearWorkItems(); } if (status != TransactionManager.STATUS_COMMITTED) { this.service.jpm.resetApplicationScopedPersistenceContext(); } }