Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
1 parent
ab26050
commit 61e11cd
Showing
2 changed files
with
34 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters