Closed DarekDan closed 3 years ago
It's not clear to me exactly what's happening from the information you've shared thus far. You don't seem to have defined the DataSource
that you're creating as a bean so Spring Boot may be auto-configuring a DataSource
for you.
It would appear that something is attempting to use Hikari when the application context is being closed by the shutdown hook. You could identify what that is by using the debugger with a breakpoint in HikariDataSource
where it logs the "Starting..." message. Alternatively, if you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue.
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Apologies. It was a user error. I had a really weird way of setting the DataSource configuration. It's all good. Closing as false positive.
I have created a multimodule Spring Boot, where the interaction with database is separated from the container. I am using Guice to inject a DataSource created in the container into the service module. The Hikari Pool is initialized in the InitializingBeen like so:
I am using H2 in-memory database with DB2 compatibility mode:
I can confirm that the SELECT query runs just fine inside the service module.
When the Spring Boot application is being shutdown, I am getting a new pool initialized, for reasons unknown, and it seems that the session initialization statement is being ignored because I get an error:
Is this a newly discovered "undocumented feature" or a user error?