Skip to content

Instantly share code, notes, and snippets.

@eugenp
Created December 23, 2011 22:35
Show Gist options
  • Save eugenp/1515564 to your computer and use it in GitHub Desktop.
Save eugenp/1515564 to your computer and use it in GitHub Desktop.
Transaction configuration with Spring 3.1 - the transaction Configuration
@Configuration
@EnableTransactionManagement
public class PersistenceJPAConfig{
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactoryBean(){
...
}
@Bean
public PlatformTransactionManager transactionManager(){
JpaTransactionManager transactionManager = new JpaTransactionManager();
transactionManager.setEntityManagerFactory(
entityManagerFactoryBean().getObject() );
return transactionManager;
}
}
@eugenp
Copy link
Author

eugenp commented Jan 29, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment