Revert "Fix APC registration for @EnableTransactionManagement"

@PostConstruct added to ProxyTransactionManagementConfiguration cases
ConcurrentModificationException (as detailed previously in SPR-8397.
Backing out for now until a better solution can be devised.

This reverts commit 235b729514d125aef79fc3fae4bcfb1893642212.
This commit is contained in:
Chris Beams
2011-07-08 09:44:29 +00:00
parent f1ef3e4dcd
commit d8d9e3fc27
3 changed files with 9 additions and 63 deletions

View File

@@ -22,7 +22,6 @@ import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -33,14 +32,9 @@ import org.junit.Test;
import org.springframework.aop.Advisor;
import org.springframework.aop.framework.Advised;
import org.springframework.aop.support.AopUtils;
import org.springframework.cache.Cache;
import org.springframework.cache.CacheManager;
import org.springframework.cache.concurrent.ConcurrentMapCache;
import org.springframework.cache.support.SimpleCacheManager;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.context.config.AdviceMode;
import org.springframework.jdbc.datasource.DataSourceTransactionManager;
import org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseBuilder;
@@ -158,38 +152,6 @@ public class EnableTransactionManagementIntegrationTests {
assertThat(txManager2.rollbacks, equalTo(0));
}
@Test
public void apcEscalation() {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext();
ctx.register(EnableTxAndCachingConfig.class);
ctx.refresh();
}
@Configuration
@EnableTransactionManagement
@ImportResource("org/springframework/transaction/annotation/enable-caching.xml")
static class EnableTxAndCachingConfig {
@Bean
public PlatformTransactionManager txManager() {
return new CallCountingTransactionManager();
}
@Bean
public FooRepository fooRepository() {
return new DummyFooRepository();
}
@Bean
public CacheManager cacheManager() {
SimpleCacheManager mgr = new SimpleCacheManager();
ArrayList<Cache> caches = new ArrayList<Cache>();
caches.add(new ConcurrentMapCache());
mgr.setCaches(caches);
return mgr;
}
}
@Configuration
@EnableTransactionManagement

View File

@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cache="http://www.springframework.org/schema/cache"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/cache http://www.springframework.org/schema/cache/spring-cache.xsd">
<cache:annotation-driven/>
</beans>