minor fix for spring config
This commit is contained in:
parent
78abeaf838
commit
5e462746e2
|
@ -2,6 +2,7 @@ package org.baeldung.spring;
|
|||
|
||||
import java.util.Properties;
|
||||
|
||||
import javax.persistence.EntityManagerFactory;
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -58,10 +59,9 @@ public class PersistenceJPAConfig {
|
|||
}
|
||||
|
||||
@Bean
|
||||
public PlatformTransactionManager transactionManager() {
|
||||
public PlatformTransactionManager transactionManager(final EntityManagerFactory emf) {
|
||||
final JpaTransactionManager transactionManager = new JpaTransactionManager();
|
||||
transactionManager.setEntityManagerFactory(entityManagerFactoryBean().getObject());
|
||||
|
||||
transactionManager.setEntityManagerFactory(emf);
|
||||
return transactionManager;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue