2

We are using the 5.2 version of broadleaf with spring-boot (using the tomcat connection pool) and mysql.

If there is no activity for a while, for example over night, it looses the connection and can't reestablish it. I have been reading about it and was aiming the use spring.datasource.tomcat.test-on-borrow and spring.datasource.validation-query properties but they don't seem to stick.

We have set up our other database properties in common-shared.properties like:

database.user=...
database.password=...
database.driver=com.mysql.jdbc.Driver
database.url=jdbc:mysql://localhost:3306/broadleaf?useUnicode=true&characterEncoding=utf8

What is the correct way to handle this problem with broadleaf?

katla
  • 43
  • 4

1 Answers1

1

Sorry about that; the Broadleaf database properties are not related to those specific properties but rather the ones that you have there as database.user ... etc from the DatabaseStarter project. Setting spring.datasource.tomcat.test-on-borrow and spring.datasource.validation-query.

However, it looks like you are hitting the exact same issue that I resolved in this PR in DatabaseStarter (like for MySQL that you are using) and this PR in HSQLDatabaseStarter (which is the default you get). So, as long as you are using the latest GAs of Broadleaf (specifically at least 5.2.1-GA) you should be good to go.

phillipuniverse
  • 2,025
  • 1
  • 14
  • 15