0
votes

Please help to understand which of the following is correct.

  1. Spring supports management of JPA PersistenceContext in combination of with local or global transaction.
  2. The JPA provider is specified by setting the vendor adaptor property on the EntityManagerFactoryBean
  3. When mapping local transaction, the JPATransactionManager uses JPA EntityManager to do the work.

It seems to me all the three statement is Incorrect. Reasons:

  1. JPA PersistenceContext support in local transaction. For global use JTA.
  2. use adaptor property on the localEntityManagerFactoryBean
  3. JPA uses EntityManagerFactory to do work.

Please help.

1

1 Answers

0
votes

I am not sure if I am correct. I am open for discussion for these three points.

  1. JPA persistence context can be propagated in JTA. This is the reference from Oracle. But I think it is applicable to Spring. https://docs.spring.io/spring-framework/docs/current/reference/html/data-access.html

  2. A vendor adapter is specified in EntityManagerFactoryBean. https://www.javadoc.io/doc/org.springframework/spring-orm/4.0.5.RELEASE/org/springframework/orm/jpa/JpaVendorAdapter.html

  3. JPATransactionManager uses EntityManagerFactory to handle transaction. https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/orm/jpa/JpaTransactionManager.html