Created
December 23, 2011 22:35
-
-
Save eugenp/1515564 to your computer and use it in GitHub Desktop.
Transaction configuration with Spring 3.1 - the transaction Configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Configuration | |
| @EnableTransactionManagement | |
| public class PersistenceJPAConfig{ | |
| @Bean | |
| public LocalContainerEntityManagerFactoryBean entityManagerFactoryBean(){ | |
| ... | |
| } | |
| @Bean | |
| public PlatformTransactionManager transactionManager(){ | |
| JpaTransactionManager transactionManager = new JpaTransactionManager(); | |
| transactionManager.setEntityManagerFactory( | |
| entityManagerFactoryBean().getObject() ); | |
| return transactionManager; | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This gist is used in:
http://www.baeldung.com/2011/12/26/transaction-configuration-with-jpa-and-spring-3-1/