From 789fafadac7d8c33a60b1ca8d6e1639b2a5ac530 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 30 Sep 2020 10:00:21 +0200 Subject: [PATCH 1/2] Start building against Spring Framework 5.3.10 snapshots See gh-23526 --- spring-boot-project/spring-boot-dependencies/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-dependencies/build.gradle b/spring-boot-project/spring-boot-dependencies/build.gradle index 4308623f9a..ee6cb157c3 100644 --- a/spring-boot-project/spring-boot-dependencies/build.gradle +++ b/spring-boot-project/spring-boot-dependencies/build.gradle @@ -1669,7 +1669,7 @@ bom { ] } } - library("Spring Framework", "5.2.9.RELEASE") { + library("Spring Framework", "5.2.10.BUILD-SNAPSHOT") { group("org.springframework") { imports = [ "spring-framework-bom" From cd15cbdc79f2ce13b54fe75668e54db9df072d19 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 30 Sep 2020 10:10:16 +0200 Subject: [PATCH 2/2] Do not execute datasource initialization in a separate thread This commit makes sure that `data.sql` is performed in the same thread as the one initializing the JPA container. Closes gh-22852 --- .../orm/jpa/DataSourceInitializedPublisher.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/DataSourceInitializedPublisher.java b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/DataSourceInitializedPublisher.java index 9896a82af3..541405b555 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/DataSourceInitializedPublisher.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/orm/jpa/DataSourceInitializedPublisher.java @@ -35,7 +35,6 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceSchemaCreatedEvent; import org.springframework.boot.jdbc.EmbeddedDatabaseConnection; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.ImportBeanDefinitionRegistrar; -import org.springframework.core.task.AsyncTaskExecutor; import org.springframework.core.type.AnnotationMetadata; import org.springframework.orm.jpa.JpaDialect; import org.springframework.orm.jpa.JpaVendorAdapter; @@ -194,11 +193,7 @@ class DataSourceInitializedPublisher implements BeanPostProcessor { @Override public void postProcessEntityManagerFactory(EntityManagerFactory entityManagerFactory) { this.delegate.postProcessEntityManagerFactory(entityManagerFactory); - AsyncTaskExecutor bootstrapExecutor = this.factoryBean.getBootstrapExecutor(); - if (bootstrapExecutor != null) { - bootstrapExecutor.execute(() -> DataSourceInitializedPublisher.this - .publishEventIfRequired(this.factoryBean, entityManagerFactory)); - } + publishEventIfRequired(this.factoryBean, entityManagerFactory); } }