Permalink
Browse files

Work around SPR-8651 with proxyTargetClass=true

  • Loading branch information...
1 parent a8ef792 commit 37e2c31e6d98f057e13a4bce3aa489fba58446a0 @cbeams cbeams committed Dec 11, 2011
Showing with 8 additions and 1 deletion.
  1. +8 −1 SPR-8651/src/test/java/org/springframework/issues/ReproTests.java
@@ -14,6 +14,8 @@
import org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor;
import org.springframework.dao.support.PersistenceExceptionTranslator;
import org.springframework.scheduling.annotation.EnableScheduling;
+import org.springframework.transaction.CallCountingTransactionManager;
+import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.EnableTransactionManagement;
/**
@@ -40,7 +42,7 @@ public void repro() throws InterruptedException {
@Configuration
@EnableScheduling
- @EnableTransactionManagement
+ @EnableTransactionManagement(proxyTargetClass=true)
static class ReproConfig {
@Bean
@@ -54,6 +56,11 @@ public PersistenceExceptionTranslationPostProcessor peTranslationPostProcessor()
}
@Bean
+ public PlatformTransactionManager txManager() {
+ return new CallCountingTransactionManager();
+ }
+
+ @Bean
public PersistenceExceptionTranslator peTranslator() {
PersistenceExceptionTranslator txlator = createMock(PersistenceExceptionTranslator.class);
replay(txlator);

0 comments on commit 37e2c31

Please sign in to comment.