spring-boot/spring-boot-project/spring-boot-autoconfigure
Andy Wilkinson 61e11cd361 Ensure that TCCL is clean when DataSource is accessed
Previously, when using Tomcat, its web app class loader was the thread
context class loader when H2ConsoleAutoConfiguration triggered
initialization of Hikari's pool. This was the case because it's done
in the bean method of a ServletRegistrationBean. Such Servlet-related
beans are intentionally created with Tomcat's web app classloader as
the TCCL. This arrangement results in the pool's threads using
Tomcat's web app class loader as their TCCL which is not desirable.
One consequence of this was that Tomcat could log a warning at
shutdown about the thread being left running when it will, in fact,
be stopped as part of the context being closed.

This commit updates H2ConsoleAutoConfiguration to set the TCCL to its
own ClassLoader while the DataSource information is being logged.

Closes gh-32382
2022-09-16 16:24:57 +01:00
..
src Ensure that TCCL is clean when DataSource is accessed 2022-09-16 16:24:57 +01:00
build.gradle Fail build on missing configuration property descriptions 2022-08-03 14:45:42 +01:00