AtlasOfLivingAustralia / image-service

Image repository and tiling services
https://images.ala.org.au
0 stars 17 forks source link

Unable to adjust connection pool properties #138

Closed sbearcsiro closed 3 years ago

sbearcsiro commented 3 years ago

Setting database pool properties (such as maximumPoolSize, connectionTimeout) has no effect when image-service is running outside of the Grails dev environment.

sbearcsiro commented 3 years ago

This appears to be caused by re-ordering of the Spring bean creation for adding Flyway db migrations. By making the dataSource bean creation depend on flyway and having flyway ensure it goes early in the creation process meant that some Grails magic wasn't applied to the Environment and attempting to retrieve the dataSource.properties configuration key as a Map returned null instead of a map of the values in the configuration file.

To fix, I'll add a separate dataSource for flyway (which IMHO is best practice anyway since it will allow the regular db user to run with fewer privileges).