From d4e19f8170abf93cdfd3f0eb590d80b83b486546 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Thu, 23 Nov 2017 11:33:16 +0000 Subject: [PATCH] Auto-configure jOOQ after transaction auto-configuration jOOQ auto-configuration will make use of a PlatformTransactionManager bean if available. This commit ensures that jOOQ is auto-configured after transaction auto-configuration, thereby ensuring that any auto-configuration PlatformTransactionManager bean can be consumed. Closes gh-11052 --- .../boot/autoconfigure/jooq/JooqAutoConfiguration.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jooq/JooqAutoConfiguration.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jooq/JooqAutoConfiguration.java index eb7208ae3b..18745d4ccc 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jooq/JooqAutoConfiguration.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jooq/JooqAutoConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,6 +38,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -53,7 +54,8 @@ import org.springframework.transaction.PlatformTransactionManager; @Configuration @ConditionalOnClass(DSLContext.class) @ConditionalOnBean(DataSource.class) -@AutoConfigureAfter(DataSourceAutoConfiguration.class) +@AutoConfigureAfter({ DataSourceAutoConfiguration.class, + TransactionAutoConfiguration.class }) public class JooqAutoConfiguration { @Bean