We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 78abeaf commit 5e46274Copy full SHA for 5e46274
spring-jpa/src/main/java/org/baeldung/spring/PersistenceJPAConfig.java
@@ -2,6 +2,7 @@
2
3
import java.util.Properties;
4
5
+import javax.persistence.EntityManagerFactory;
6
import javax.sql.DataSource;
7
8
import org.springframework.beans.factory.annotation.Autowired;
@@ -58,10 +59,9 @@ public DataSource dataSource() {
58
59
}
60
61
@Bean
- public PlatformTransactionManager transactionManager() {
62
+ public PlatformTransactionManager transactionManager(final EntityManagerFactory emf) {
63
final JpaTransactionManager transactionManager = new JpaTransactionManager();
- transactionManager.setEntityManagerFactory(entityManagerFactoryBean().getObject());
64
-
+ transactionManager.setEntityManagerFactory(emf);
65
return transactionManager;
66
67
0 commit comments