The current version of MySQL-connector (v8.0.21) doesn’t provide support to set SERVER TIMEZONE via the connection string(it’s a bug). Due to this fact, the server timezone defaults to UTC. This is problematic!! Causes errors building search Index for some patients ~ affects patient search
To fix the issue. IMO I’ve got two options here:
- Upgrade mysql-connector to at least
v8.0.23
- Revert mysql-connector to use 5.x (the one used by previous platform version 2.3.x)
This commit FORCED TO SET SERVER TIMEZONE IN CONNECT STRING. Fixes the above issue. However, with this upgrade comes incompatibility issues and some breaking changes. I tried upgrading mysql-connector to v8.0.25
, couldn’t brought up the server. I encoutered errors one after the other, for example; this might implies upgrade liquibase-core to a higher version.
java.lang.ClassCastException: class java.time.LocalDateTime cannot be cast to class java.lang.String (java.time.LocalDateTime and java.lang.String are in module java.base of loader 'bootstrap')
amrs-upgrade | at liquibase.changelog.StandardChangeLogHistoryService.getRanChangeSets(StandardChangeLogHistoryService.java:328) ~[liquibase-core-3.10.2.jar:?]
amrs-upgrade | at liquibase.changelog.AbstractChangeLogHistoryService.upgradeChecksums(AbstractChangeLogHistoryService.java:66) ~[liquibase-core-3.10.2.jar:?]
amrs-upgrade | at liquibase.changelog.StandardChangeLogHistoryService.upgradeChecksums(StandardChangeLogHistoryService.java:297) ~[liquibase-core-3.10.2.jar:?]
Option two is much safer(I chose to do this), this how i fix the issue checkout tag 2.4.0, downgrade mysql-connector to v5.1.47
(latest in 5.1.x), change hibernate connection driver class from com.mysql.cj.jdbc.Driver
to com.mysql.jdbc.Driver
. Now I can set serverTimezone=EAT
in the connection string.
Is there a better way of fixing the issue above?