-
-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spring Boot: always-persist-timestamp-in-utc has no effect #487
Comments
I think this is caused by this part of // Use custom JdbcCustomizer if provided.
builder.jdbcCustomization(
customizer
.jdbcCustomization()
.orElse(new AutodetectJdbcCustomization(transactionalDataSource))); The default final JdbcCustomization jdbcCustomization =
ofNullable(this.jdbcCustomization)
.orElseGet(
() -> new AutodetectJdbcCustomization(dataSource, alwaysPersistTimestampInUTC)); I think this can be fixed by simply removing the default // Use custom JdbcCustomizer if provided.
customizer.jdbcCustomization().ifPresent(builder::jdbcCustomization); |
…#490) ## Brief, plain english overview of your changes here I've changed the Spring Boot auto-configuration to ensure that the `jdbcCustomization` default does not override the configured `alwaysPersistTimestampInUTC` default. The previous `orElse` part is not necessary because the correct `jdbcCustomization` default later gets applied in `SchedulerBuilder#build`. ## Fixes Fixes #487 ## Reminders - [ ] Added/ran automated tests - I don't know how to add an efficient test for this. - I ran the tests but I got an unrelated error in an Oracle compatibility test, even without this change. - [ ] Update README and/or examples - I don't think this is relevant. - [ ] Ran `mvn spotless:apply` - This only changed unrelated code. --- Co-authored-by: Georg Echterling <g.echterling@jobware.de>
🎉 This issue has been resolved in |
Expected Behavior
Setting the Spring property
db-scheduler.always-persist-timestamp-in-utc=true
should create anAutodetectJdbcCustomization
withpersistTimestampInUTC = true
.Current Behavior
Setting
db-scheduler.always-persist-timestamp-in-utc=true
has no effect on the createdAutodetectJdbcCustomization
. TheJdbcCustomization
must be manually corrected via aDbSchedulerCustomizer
.In the case of MariaDB, the "utc_warning" still gets logged. It is also impossible to prevent this warning (except by silencing the logs), since even overriding the
JdbcCustomization
with a corrected version doesn't prevent theDbSchedulerAutoConfiguration
from temporarily creating the incorrect variant.For bug reports
Steps to Reproduce the bug
db-scheduler-spring-boot-starter
db-scheduler.always-persist-timestamp-in-utc=true
Context
Logs
The text was updated successfully, but these errors were encountered: