Stop deferring JPA bootstrap mode by default

This commit changes the default value of bootstrap-mode to "default"
rather than "deferred" so that the JPA infrastructure starts in the
main thread rather than asynchronously.

Closes gh-24249
This commit is contained in:
Stephane Nicoll
2020-12-08 15:42:14 +01:00
parent f84cb1b765
commit 06671aa50e
7 changed files with 12 additions and 12 deletions

View File

@@ -126,13 +126,12 @@ class JpaRepositoriesAutoConfigurationTests {
}
@Test
void bootstrapModeIsDeferredByDefault() {
void bootstrapModeIsDefaultByDefault() {
this.contextRunner.withUserConfiguration(MultipleAsyncTaskExecutorConfiguration.class)
.withConfiguration(AutoConfigurations.of(TaskExecutionAutoConfiguration.class,
TaskSchedulingAutoConfiguration.class))
.run((context) -> assertThat(
context.getBean(LocalContainerEntityManagerFactoryBean.class).getBootstrapExecutor())
.isEqualTo(context.getBean("applicationTaskExecutor")));
context.getBean(LocalContainerEntityManagerFactoryBean.class).getBootstrapExecutor()).isNull());
}
@Configuration(proxyBeanMethods = false)