public void checkRollbackAndThrow() throws Exception{ PlatformTransactionManager transactionManager=MicroTranManagerHolder.getTransactionManager(dbName); boolean flag=((AbstractPlatformTransactionManager) transactionManager).isFailEarlyOnGlobalRollbackOnly(); if(flag){ throw new RuntimeException("dbTranNestRollbackAndThrow"); } }
protected TransactionStatus startTransaction() { DefaultTransactionDefinition def = new DefaultTransactionDefinition(); def.setName("StatsTransaction"); def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED); AbstractPlatformTransactionManager txManager = getTransactionManager(); return txManager.getTransaction(def); }
private void startTransaction() { DefaultTransactionDefinition def = new DefaultTransactionDefinition(); def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED); AbstractPlatformTransactionManager txManager = getTransactionManager(); transactionStartTime = DateTime.now(); this.transactionStatus = txManager.getTransaction(def); }
public StatefulKnowledgeSession createSession() { System.setProperty("jbpm.enable.multi.con", Boolean.toString(true)); Properties props = new Properties(); props.put("drools.processInstanceManagerFactory", JPAProcessInstanceManagerFactory.class.getName()); props.put("drools.workItemManagerFactory", JPAWorkItemManagerFactory.class.getName()); props.put("drools.processSignalManagerFactory", JPASignalManagerFactory.class.getName()); KnowledgeSessionConfiguration ksconf = KnowledgeBaseFactory.newKnowledgeSessionConfiguration(props); Environment env = KnowledgeBaseFactory.newEnvironment(); env.set(EnvironmentName.PERSISTENCE_CONTEXT_MANAGER, processPersistenceContextManager); AnnotationTransactionAspect txAspect = AnnotationTransactionAspect.aspectOf(); AbstractPlatformTransactionManager txManager = (AbstractPlatformTransactionManager) txAspect.getTransactionManager(); LOG.debug("Transaction manager: " + txManager.toString()); TransactionManager tm = new UnoTransactionManager(txManager, (UnoProcessPersistenceContext) processPersistenceContextManager.getProcessPersistenceContext()); env.set(EnvironmentName.TRANSACTION_MANAGER, tm); Integer sessionId = knowledgeIdResolver.getKnowledgeSessionId(); SingleSessionCommandService sscs; KnowledgeBase kBase = knowledgeBaseProvider.getKnowledgeBase(); if (sessionId == null) { sscs = new SingleSessionCommandService(kBase, ksconf, env); knowledgeIdResolver.saveKnowledgeSessionId(sscs.getSessionId()); } else { sscs = new SingleSessionCommandService(sessionId, kBase, ksconf, env); } return new CommandBasedStatefulKnowledgeSession(sscs); }
public SearchPlatformTransactionManager(AbstractPlatformTransactionManager platformTransactionManager, EventSupport eventSupport) { this.platformTransactionManager = platformTransactionManager; this.eventSupport = eventSupport; }
@Bean public AbstractPlatformTransactionManager graviteeTransactionManager() { return new NoTransactionManager(); }
protected AbstractPlatformTransactionManager getTransactionManager() { return (AbstractPlatformTransactionManager) ContextHelper.get().getBean("artifactoryTransactionManager"); }
private AbstractPlatformTransactionManager getTransactionManager() { return (AbstractPlatformTransactionManager) ContextHelper.get().getBean("artifactoryTransactionManager"); }
public UnoTransactionManager(AbstractPlatformTransactionManager ptm, UnoProcessPersistenceContext unoProcessPersistenceContext) { super(ptm); this.unoProcessPersistenceContext = unoProcessPersistenceContext; }