Announcement Announcement Module
Collapse
No announcement yet.
Auto Flush not working for Spring 3.1 LocalEntityManagerFactoryBean+Hibernate 4+JTA Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    I assumed you had the correct transaction_type.

    You could try and configure an additional PersistenceUnitPostProcessor implementation which sets the transaction type to JTA.

    Comment


    • #17
      I didn't expect the transaction type can be the cause of problem, as Spring 3.1 provide the xml-less JPA bootstrapping, and, in my past project, I used to use LOCAL_RESOURCES transaction type in persistence.xml and it works fine (Spring 2.5 + Hibernate 3 + WebLogic).

      Good suggestion on the PU Post Processor, lemme have a try on that

      Comment


      • #18
        Hi Adrian,

        I'm also stuck in similar problem with tech stack Spring data JPA, Hibernate, WebSphere 6.1.0.39. Wondering if you managed to raise a bug as you mentioned in the post. Currently I'm not in favour of using the persistence.xml but will use if its the only option.

        Thanks & Regards,
        Irfan

        Comment


        • #19
          Marten/adrianshum

          Thanks for the posts, this one had me confused for a few minutes. I just wanted to add if you are using the classpath scanning on the LocalContainerEntityManagerFactoryBean that is fine just make sure you set the JtaDatasource, not the DataSource

          Code:
                  @Bean
                  public LocalContainerEntityManagerFactoryBean localContainerEntityManagerFactoryBean()
                  {
                      LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean();
                      lef.setJtaDataSource(datasource());
                      lef.setPackagesToScan("com.xxx.yyy.model.entity");
                      lef.setJpaProperties(jpaProperties());
                      lef.setJpaVendorAdapter(jpaVendorAdapter());
                      return lef;
                  }

          Comment

          Working...
          X