From 301b8bc6114c8b79dbda201d380bed0a0cafbe08 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Thu, 29 Dec 2016 10:38:11 +0100 Subject: [PATCH 1/2] Make the dependency to TransactionAutoConfiguration explicit Closes gh-7773 --- .../autoconfigure/data/neo4j/Neo4jDataAutoConfiguration.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jDataAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jDataAutoConfiguration.java index 7d8ffa3a99..25ba2f8318 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jDataAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/data/neo4j/Neo4jDataAutoConfiguration.java @@ -23,12 +23,14 @@ import org.neo4j.ogm.session.event.EventListener; import org.springframework.beans.factory.ObjectProvider; import org.springframework.boot.autoconfigure.AutoConfigurationPackages; +import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; import org.springframework.boot.autoconfigure.domain.EntityScanPackages; +import org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration; import org.springframework.boot.autoconfigure.transaction.TransactionManagerCustomizers; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.ApplicationContext; @@ -53,6 +55,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter * @since 1.4.0 */ @Configuration +@AutoConfigureAfter(TransactionAutoConfiguration.class) @ConditionalOnClass({ SessionFactory.class, PlatformTransactionManager.class }) @ConditionalOnMissingBean(SessionFactory.class) @EnableConfigurationProperties(Neo4jProperties.class) From 1f5970c5373d973d268a30209673a164068b61e9 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Thu, 29 Dec 2016 10:49:19 +0100 Subject: [PATCH 2/2] Fix auto-configuration class reference Closes gh-7781 --- .../transaction/TransactionAutoConfiguration.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/TransactionAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/TransactionAutoConfiguration.java index 58b05bb687..5a05d4ba4c 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/TransactionAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/transaction/TransactionAutoConfiguration.java @@ -21,7 +21,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnSingleCandidate; import org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration; -import org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration; +import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration; import org.springframework.boot.autoconfigure.transaction.jta.JtaAutoConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -38,7 +38,7 @@ import org.springframework.transaction.support.TransactionTemplate; @Configuration @ConditionalOnClass({ TransactionTemplate.class, PlatformTransactionManager.class }) @ConditionalOnSingleCandidate(PlatformTransactionManager.class) -@AutoConfigureAfter({ JtaAutoConfiguration.class, JpaBaseConfiguration.class, +@AutoConfigureAfter({ JtaAutoConfiguration.class, HibernateJpaAutoConfiguration.class, DataSourceTransactionManagerAutoConfiguration.class }) public class TransactionAutoConfiguration {