Examples of JpaTransactionManager


Examples of org.springframework.orm.jpa.JpaTransactionManager

    protected void cleanupRepository() {
        jpaTemplate = (JpaTemplate)applicationContext.getBean("jpaTemplate", JpaTemplate.class);

        TransactionTemplate transactionTemplate = new TransactionTemplate();
        transactionTemplate.setTransactionManager(new JpaTransactionManager(jpaTemplate.getEntityManagerFactory()));
        transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);

        transactionTemplate.execute(new TransactionCallback() {
            public Object doInTransaction(TransactionStatus arg0) {
                List list = jpaTemplate.find(SELECT_ALL_STRING);
View Full Code Here

Examples of org.springframework.orm.jpa.JpaTransactionManager

    }
  
    @Bean
    public PlatformTransactionManager transactionManager(){
    
        JpaTransactionManager tm = new JpaTransactionManager();
     
      tm.setEntityManagerFactory(
            this.entityManagerFactory().getObject() );
     
        return tm;
   
    }
View Full Code Here

Examples of org.springframework.orm.jpa.JpaTransactionManager

    @SuppressWarnings("unchecked")
    protected void cleanupRepository() {
        jpaTemplate = (JpaTemplate)applicationContext.getBean("jpaTemplate", JpaTemplate.class);

        TransactionTemplate transactionTemplate = new TransactionTemplate();
        transactionTemplate.setTransactionManager(new JpaTransactionManager(jpaTemplate.getEntityManagerFactory()));
        transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);

        transactionTemplate.execute(new TransactionCallback() {
            public Object doInTransaction(TransactionStatus arg0) {
                List list = jpaTemplate.find(SELECT_ALL_STRING);
View Full Code Here

Examples of org.springframework.orm.jpa.JpaTransactionManager

    @SuppressWarnings("unchecked")
    protected void cleanupRepository() {
        jpaTemplate = (JpaTemplate)applicationContext.getBean("jpaTemplate", JpaTemplate.class);

        TransactionTemplate transactionTemplate = new TransactionTemplate();
        transactionTemplate.setTransactionManager(new JpaTransactionManager(jpaTemplate.getEntityManagerFactory()));
        transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);

        transactionTemplate.execute(new TransactionCallback() {
            public Object doInTransaction(TransactionStatus arg0) {
                List list = jpaTemplate.find(SELECT_ALL_STRING);
View Full Code Here

Examples of org.springframework.orm.jpa.JpaTransactionManager

    protected void cleanupRepository() {
        // must type cast with Spring 2.x
        jpaTemplate = (JpaTemplate) applicationContext.getBean("jpaTemplate");

        TransactionTemplate transactionTemplate = new TransactionTemplate();
        transactionTemplate.setTransactionManager(new JpaTransactionManager(jpaTemplate.getEntityManagerFactory()));
        transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);

        transactionTemplate.execute(new TransactionCallback() {
            public Object doInTransaction(TransactionStatus arg0) {
                List list = jpaTemplate.find(SELECT_ALL_STRING);
View Full Code Here

Examples of org.springframework.orm.jpa.JpaTransactionManager

  protected void setUp() throws Exception {
    DataSource dataSource = getDataSource();
    populateDataBase(dataSource);
    entityManagerFactory = getEntityManagerFactory(dataSource);
    JpaTransactionManager tm = new JpaTransactionManager(entityManagerFactory);
    jpaListener = new JpaFlowExecutionListener(entityManagerFactory, tm);

    ClassPathResource res = new ClassPathResource("flow-managed-persistence.xml", getClass());
    DefaultFlowModelHolder holder = new DefaultFlowModelHolder(new XmlFlowModelBuilder(res));
    FlowModelFlowBuilder builder = new FlowModelFlowBuilder(holder);
View Full Code Here

Examples of org.springframework.orm.jpa.JpaTransactionManager

  protected void setUp() throws Exception {
    DataSource dataSource = getDataSource();
    populateDataBase(dataSource);
    jdbcTemplate = new JdbcTemplate(dataSource);
    entityManagerFactory = getEntityManagerFactory(dataSource);
    JpaTransactionManager tm = new JpaTransactionManager(entityManagerFactory);
    jpaListener = new JpaFlowExecutionListener(entityManagerFactory, tm);
    jpaTemplate = new JpaTemplate(entityManagerFactory);
  }
View Full Code Here

Examples of org.springframework.orm.jpa.JpaTransactionManager

  @ExternalBean
  public abstract EntityManagerFactory entityManagerFactory();
 
  @Bean(scope = DefaultScopes.SINGLETON, aliases="transactionManager")
  public PlatformTransactionManager transactionManagerConfig() throws Exception {
    JpaTransactionManager transactionManager = new JpaTransactionManager();
    transactionManager.setEntityManagerFactory(entityManagerFactory());
    return transactionManager;
  }
View Full Code Here

Examples of org.springframework.orm.jpa.JpaTransactionManager

    protected void cleanupRepository() {
        jpaTemplate = (JpaTemplate)applicationContext.getBean("jpaTemplate", JpaTemplate.class);

        TransactionTemplate transactionTemplate = new TransactionTemplate();
        transactionTemplate.setTransactionManager(new JpaTransactionManager(jpaTemplate.getEntityManagerFactory()));
        transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);

        transactionTemplate.execute(new TransactionCallback() {
            public Object doInTransaction(TransactionStatus arg0) {
                List list = jpaTemplate.find(SELECT_ALL_STRING);
View Full Code Here

Examples of org.springframework.orm.jpa.JpaTransactionManager

    @SuppressWarnings("unchecked")
    protected void cleanupRepository() {
        jpaTemplate = (JpaTemplate)applicationContext.getBean("jpaTemplate", JpaTemplate.class);

        TransactionTemplate transactionTemplate = new TransactionTemplate();
        transactionTemplate.setTransactionManager(new JpaTransactionManager(jpaTemplate.getEntityManagerFactory()));
        transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);

        transactionTemplate.execute(new TransactionCallback() {
            public Object doInTransaction(TransactionStatus arg0) {
                List list = jpaTemplate.find(SELECT_ALL_STRING);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.