@Bean(name = "transactionManager") public JpaTransactionManager transactionManager() throws IOException { JpaTransactionManager txManager = new JpaTransactionManager(); txManager.setEntityManagerFactory(emf().getObject()); return txManager; }
@Bean public PlatformTransactionManager transactionManager() { JpaTransactionManager txManager = new JpaTransactionManager(); txManager.setEntityManagerFactory(entityManagerFactory()); return txManager; }
@Bean public JpaTransactionManager transactionManager() { JpaTransactionManager jpaTransactionManager = new JpaTransactionManager(); jpaTransactionManager.setEntityManagerFactory(entityManagerFactory().getObject()); jpaTransactionManager.setJpaDialect(jpaDialect()); return jpaTransactionManager; }
@Bean public PlatformTransactionManager transactionManager() { JpaTransactionManager tm = new JpaTransactionManager(); tm.setEntityManagerFactory(emf); tm.setDataSource(dataSource); return tm; }
@Bean public JpaTransactionManager transactionManager(EntityManagerFactory emf) { JpaTransactionManager transactionManager = new JpaTransactionManager(); transactionManager.setEntityManagerFactory(emf); return transactionManager; }
@Qualifier("user_manager") @Bean(name = "user_manager_TransactionManager") public PlatformTransactionManager transactionManager() { final JpaTransactionManager transactionManager = new JpaTransactionManager(); transactionManager.setEntityManagerFactory(entityManagerFactory().getObject()); return transactionManager; }
@Bean public PlatformTransactionManager transactionManager() { final JpaTransactionManager transactionManager = new JpaTransactionManager(); transactionManager.setEntityManagerFactory(entityManagerFactory().getObject()); return transactionManager; }
@Bean public JpaTransactionManager transactionManager() throws ClassNotFoundException { JpaTransactionManager transactionManager = new JpaTransactionManager(); transactionManager.setEntityManagerFactory(entityManagerFactoryBean().getObject()); return transactionManager; }
@Bean(name = "transactionManager") public PlatformTransactionManager transactionManager( EntityManagerFactory entityManagerFactory, DataSource dataSource) { JpaTransactionManager transactionManager = new JpaTransactionManager(); transactionManager.setEntityManagerFactory(entityManagerFactory); transactionManager.setDataSource(dataSource); return transactionManager; }
@Override @Bean @Primary public PlatformTransactionManager annotationDrivenTransactionManager() { JpaTransactionManager tm = new JpaTransactionManager(); tm.setPersistenceUnitName("rgbycchPU"); return tm; }
/** * Transaction manager. * * @param dataSource * @param entityManagerFactory * @return transaction manager */ @Bean(name = "txManager") public JpaTransactionManager jpaTransactionManager( DataSource dataSource, EntityManagerFactory entityManagerFactory) { JpaTransactionManager tm = new JpaTransactionManager(); tm.setDataSource(dataSource); tm.setEntityManagerFactory(entityManagerFactory); return tm; }
@Bean @Autowired public JpaTransactionManager transactionManager(EntityManagerFactory entityManagerFactory) { JpaTransactionManager txManager = new JpaTransactionManager(); JpaDialect jpaDialect = new HibernateJpaDialect(); txManager.setEntityManagerFactory(entityManagerFactory); txManager.setJpaDialect(jpaDialect); return txManager; }
@Bean public PlatformTransactionManager transactionManager() throws ClassNotFoundException { JpaTransactionManager transactionManager = new JpaTransactionManager(); transactionManager.setEntityManagerFactory(entityManagerFactory()); transactionManager.setDataSource(dataSource()); return transactionManager; }
@Override public void update(Artifact artifact) { logger.info("update()"); TransactionStatus status = transactionManager.getTransaction(new DefaultTransactionDefinition()); em.persist(em.merge(artifact)); transactionManager.commit(status); }
@Override public void delete(Artifact artifact) { logger.info("delete(Artifact(" + artifact.getId() + "))"); TransactionStatus status = transactionManager.getTransaction(new DefaultTransactionDefinition()); em.remove(em.merge(artifact)); transactionManager.commit(status); }
@Bean @Autowired public PlatformTransactionManager transactionManager(EntityManagerFactory emf) { JpaTransactionManager transactionManager = new JpaTransactionManager(); transactionManager.setEntityManagerFactory(emf); return transactionManager; }
@Override public void delete(Long id) { logger.info("delete(" + id + ")"); TransactionStatus status = transactionManager.getTransaction(new DefaultTransactionDefinition()); em.createNamedQuery(Artifact.Q_DELETE_BY_ID, Artifact.class) .setParameter("id", id) .executeUpdate(); transactionManager.commit(status); }
@Override protected void doBegin(final Object transaction, final TransactionDefinition definition) { JdbcTransactionObjectSupport txObject = (JdbcTransactionObjectSupport) transaction; try { super.doBegin(transaction, definition); } catch (TransactionException ex) { rollbackAfterFailedBegin(txObject); throw ex; } catch (Exception ex) { rollbackAfterFailedBegin(txObject); throw new CannotCreateTransactionException( "Could not open JPA EntityManager for transaction", ex); } }
public void initStartDisposeAndLoadSession() { try { EntityManager em = txm.getEntityManagerFactory().createEntityManager(); // create new ksession with kstore KieSession ksession = kstore.newKieSession(kbase, null, getEnvironment()); sessionId = ksession.getId(); logger.info("\n\tSession id: " + sessionId + "\n"); ksession.getWorkItemManager().registerWorkItemHandler("testWorkItemHandler", workItemHandler); ksession.startProcess("timer-flow", null); Thread.sleep(4000); ksession.dispose(); } catch (Exception ex) { throw new IllegalStateException("The endTheProcess method has been interrupted", ex); } }
@Override protected void doCleanupAfterCompletion(final Object transaction) { try { super.doCleanupAfterCompletion(transaction); } finally { JdbcTransactionObjectSupport transactionObj = (JdbcTransactionObjectSupport) transaction; EntityManager em = _newTransactionObjects.remove(transactionObj); if (em != null) { EntityManagerHolder holder = (EntityManagerHolder) TransactionSynchronizationManager.unbindResource(getEntityManagerFactory()); LOGGER.debug( "doCleanupAfterCompletion() unbound holder [{}] and removed transactionObj [{}]", holder, transactionObj); } } }
@Bean() public JpaTransactionManager transactionManager(EntityManagerFactory entityManagerFactory) { JpaTransactionManager retVal = new JpaTransactionManager(); retVal.setEntityManagerFactory(entityManagerFactory); return retVal; }
/** * Configures default JPA transaction behavior. * * @return PlatformTransactionManager * @see PlatformTransactionManager */ @Bean public PlatformTransactionManager transactionManager() { JpaTransactionManager txm = new JpaTransactionManager(); txm.setEntityManagerFactory(entityManagerFactory().getObject()); return txm; }
public SpringJPAPersistenceManager( JpaTransactionManager transactionManager, TideTransactionManager tm) { super(transactionManager.getEntityManagerFactory(), tm); }
@Bean public JpaTransactionManager transactionManager() throws URISyntaxException { JpaTransactionManager transactionManager = new JpaTransactionManager(); transactionManager.setEntityManagerFactory(entityManagerFactory().getObject()); return transactionManager; }
@Bean(name = "transactionManager") public PlatformTransactionManager transactionManager(EntityManagerFactory emf) { JpaTransactionManager transactionManager = new JpaTransactionManager(); transactionManager.setEntityManagerFactory(emf); return transactionManager; }
@Bean JpaTransactionManager transactionManager(EntityManagerFactory entityManagerFactory) { JpaTransactionManager transactionManager = new JpaTransactionManager(); transactionManager.setEntityManagerFactory(entityManagerFactory); return transactionManager; }
@Bean public PlatformTransactionManager transactionManager(final EntityManagerFactory emf) { final JpaTransactionManager transactionManager = new JpaTransactionManager(); transactionManager.setEntityManagerFactory(emf); return transactionManager; }
@Bean(name = "transactionManager") public PlatformTransactionManager transactionManager() { JpaTransactionManager transactionManager = new JpaTransactionManager(); transactionManager.setEntityManagerFactory(entityManagerFactoryBean().getObject()); return transactionManager; }
protected PlatformTransactionManager createTransactionManager() { JpaTransactionManager tm = new JpaTransactionManager(getEntityManagerFactory()); tm.afterPropertiesSet(); return tm; }
public static PlatformTransactionManager createTransactionManager( EntityManagerFactory entityManagerFactory) { JpaTransactionManager tm = new JpaTransactionManager(); tm.setEntityManagerFactory(entityManagerFactory); return tm; }