Spring Boot supports a number of DataSources using DataSourceProperties
but the level of support is not the same. Some datasources have dedicated support (with fine-grained properties support) and we have a best effort support for others if the user opt-in for that explicitly using .type
.
That best effort is mostly about aliasing core properties (such as mapping setUserName
to setUser
). In 2.4.x we only map an alias for a datasource we know about (rather than just adding such alias regardless of the type).
We should document those so that it's clear that if the user opt-in for a type, this may or may not be supported.
Comment From: tinselspoon
Please could this also be added to the release notes? I just hit this issue and couldn't find an indication that the behaviour had changed from the upgrade notes.
Comment From: snicoll
What issue did you hit exactly? Please also review https://github.com/spring-projects/spring-boot/issues/25263#issuecomment-780403800
Comment From: tinselspoon
It was the issue described in that linked comment in that the user
-> username
alias is no longer being applied (although in our case we were using a PGSimpleDataSource
). Having a heads-up about this change in the release notes would be good for the folks relying on this without realising it, as it would have always "just worked" before.
Comment From: snicoll
@tinselspoon this infrastructure is meant to be used only with the DataSource implementations that Spring Boot supports officially and PGSimpleDataSource
isn't one of them. It was working so far by accident. Having said that and since we manage it I am inclined to add an explicit alias for it.
See #25363