minor fix for spring config

This commit is contained in:
eugenp 2013-12-22 00:41:51 +02:00
parent 78abeaf838
commit 5e462746e2
1 changed files with 3 additions and 3 deletions

View File

@ -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;
}