Spring Boot in the presence of the configuration of the database immediately raises the connection to the database and checks it. If there is no connection to the database, an error is immediately thrown out and the application stops working.

If the database connection is slow, how to configure it so that the connection itself occurs only during the database operation?

    1 answer 1

    Try adding

    spring.datasource.continue-on-error=true 

    https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html

    spring.datasource.continue-on-error = false # if it’s an error occurs while initializing the database

    • Thank you, yes it solves the problem during initialization, but will it work when executing commands? - dreadangel