SAP Knowledge Base Article - Preview

3326071 - Invalid Date after switching to DST(daylight saving time)

Symptom

When writing the modifiedtime of an Item after the switch to the DST(daylight saving time), two items in My SQL database - one cart and one cronjob - which had a modifiedtime of '2023-03-26T02:00:00' in the database.

Those two instances could not be loaded by SAP Commerce any longer, Java complains about the date was not valid. It happened on the attribute modifiedTime of type Item.

Error logs:

INFO   | jvm 1    | main    | 2023/03/27 03:00:10.877 | Caused by: java.sql.SQLException: HOUR_OF_DAY: 2 -> 3
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.877 |         at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.877 |         at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:85)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at com.mysql.cj.jdbc.result.ResultSetImpl.getTimestamp(ResultSetImpl.java:947)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at com.mysql.cj.jdbc.result.ResultSetImpl.getTimestamp(ResultSetImpl.java:985)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at de.hybris.platform.jdbcwrapper.interceptor.ResultSetWithJDBCInterceptor.lambda$33(ResultSetWithJDBCInterceptor.java:217)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at de.hybris.platform.jdbcwrapper.interceptor.recover.SQLRecoverableExceptionHandler.passThrough(SQLRecoverableExceptionHandler.java:93)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at de.hybris.platform.jdbcwrapper.interceptor.recover.SQLRecoverableExceptionHandler.get(SQLRecoverableExceptionHandler.java:51)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at de.hybris.platform.jdbcwrapper.interceptor.JDBCInterceptor.get(JDBCInterceptor.java:61)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at de.hybris.platform.jdbcwrapper.interceptor.ResultSetWithJDBCInterceptor.getTimestamp(ResultSetWithJDBCInterceptor.java:217)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at de.hybris.platform.jdbcwrapper.ResultSetImpl.getTimestamp(ResultSetImpl.java:399)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at de.hybris.platform.persistence.property.JDBCValueMappings$DefaultDateTimestampValueReaderWriter.readValue(JDBCValueMappings.java:1735)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at de.hybris.platform.persistence.property.JDBCValueMappings$DefaultDateTimestampValueReaderWriter.readValue(JDBCValueMappings.java:1)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at de.hybris.platform.persistence.property.JDBCValueMappings$AbstractValueReaderWriter.getValue(JDBCValueMappings.java:558)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at de.hybris.platform.persistence.GenericBMPBean$GenericItemEntityState.setStateFromResultSet(GenericBMPBean.java:1346)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         ... 76 more

INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 | Caused by: com.mysql.cj.exceptions.WrongArgumentException: HOUR_OF_DAY: 2 -> 3
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at jdk.internal.reflect.GeneratedConstructorAccessor2604.newInstance(Unknown Source)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:105)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at com.mysql.cj.result.SqlTimestampValueFactory.localCreateFromDatetime(SqlTimestampValueFactory.java:195)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at com.mysql.cj.result.SqlTimestampValueFactory.localCreateFromDatetime(SqlTimestampValueFactory.java:51)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.878 |         at com.mysql.cj.result.AbstractDateTimeValueFactory.createFromDatetime(AbstractDateTimeValueFactory.java:104)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.879 |         at com.mysql.cj.protocol.a.MysqlTextValueDecoder.decodeDatetime(MysqlTextValueDecoder.java:90)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.879 |         at com.mysql.cj.protocol.result.AbstractResultsetRow.decodeAndCreateReturnValue(AbstractResultsetRow.java:86)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.879 |         at com.mysql.cj.protocol.result.AbstractResultsetRow.getValueFromBytes(AbstractResultsetRow.java:243)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.879 |         at com.mysql.cj.protocol.a.result.TextBufferRow.getValue(TextBufferRow.java:132)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.879 |         ... 88 more
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.879 | Caused by: java.lang.IllegalArgumentException: HOUR_OF_DAY: 2 -> 3
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.879 |         at java.base/java.util.GregorianCalendar.computeTime(GregorianCalendar.java:2826)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.879 |         at java.base/java.util.Calendar.updateTime(Calendar.java:3428)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.879 |         at java.base/java.util.Calendar.getTimeInMillis(Calendar.java:1812)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.879 |         at com.mysql.cj.result.SqlTimestampValueFactory.localCreateFromDatetime(SqlTimestampValueFactory.java:191)
INFO   | jvm 1    | main    | 2023/03/27 03:00:10.879 |         ... 94 more


Read more...

Environment

SAP Commerce 2205 onPrem

Product

SAP Commerce all versions

Keywords

timezone, date, time, dateTime, DST, UTC , KBA , CEC-SCC-PLA-PL , Platform , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.