문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
|
springframework:javaconfig:enabletransactionmanagement [2013/12/20 16:48] kwon37xi |
springframework:javaconfig:enabletransactionmanagement [2015/10/12 17:05] (현재) kwon37xi |
||
|---|---|---|---|
| 줄 1: | 줄 1: | ||
| ====== Spring Framework @EnableTransactionManagement ====== | ====== Spring Framework @EnableTransactionManagement ====== | ||
| + | * [[springframework: | ||
| * [[http:// | * [[http:// | ||
| * [[springframework: | * [[springframework: | ||
| + | |||
| + | |||
| + | > 경고 : Spring 4.1.4 미만 버전의 경우 **TransactionManagementConfigurer로 기본 Transaction Manager를 지정하면 @Transactional(value=" | ||
| + | > [[https:// | ||
| + | > 4.1.4 버전에도 [[https:// | ||
| + | |||
| * '' | * '' | ||
| * 따라서 특정 트랜잭션 매니저를 디폴트로 지정하고자 한다면 Java Config 클래스가 [[http:// | * 따라서 특정 트랜잭션 매니저를 디폴트로 지정하고자 한다면 Java Config 클래스가 [[http:// | ||
| @Configuration | @Configuration | ||
| public class TransactionManageConfig implements TransactionManagementConfigurer { | public class TransactionManageConfig implements TransactionManagementConfigurer { | ||
| - | | + | // 직접 Bean으로 지정 |
| - | public PlatformTransactionManager annotationDrivenTransactionManager() { | + | |
| - | return new SomePlatformTransactionManager(tma, tmb); | + | @Override |
| - | } | + | |
| + | | ||
| + | } | ||
| + | |||
| + | // 다른 빈을 리턴 | ||
| + | | ||
| + | | ||
| + | | ||
| + | } | ||
| + | |||
| + | | ||
| + | | ||
| + | | ||
| + | } | ||
| } | } | ||
| </ | </ | ||
| * 아니면 특정 트랜잭션 매니저 생성시 [[http:// | * 아니면 특정 트랜잭션 매니저 생성시 [[http:// | ||
| - | @Bean | + | @Bean |
| - | @Primary | + | @Primary |
| - | public ChainedTransactionManager transactionManager() { | + | public ChainedTransactionManager transactionManager() { |
| - | return new SomePlatformTransactionManager(); | + | return new SomePlatformTransactionManager(); |
| - | } | + | } |
| </ | </ | ||