How fix postgres breaks connection after certain time?

Sep 11, 2021 | - views

Add to application.properties:
spring.datasource.validation-query=select 1
spring.datasource.test-on-borrow=true