You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Calendar is not thread-safe, so the following DAO call can lead to issues because UTC_CALENDAR is declared as static (and therefore shared by multiple threads):
java.lang.ArrayIndexOutOfBoundsException: Array index out of range: -602
at java.base/sun.util.calendar.BaseCalendar.getCalendarDateFromFixedDate(BaseCalendar.java:453)
at java.base/java.util.GregorianCalendar.computeFields(GregorianCalendar.java:2394)
at java.base/java.util.GregorianCalendar.computeTime(GregorianCalendar.java:2815)
at java.base/java.util.Calendar.updateTime(Calendar.java:3428)
at java.base/java.util.Calendar.getTimeInMillis(Calendar.java:1812)
at org.apache.derby.iapi.types.SQLTimestamp.getTimestamp(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedResultSet.getTimestamp(Unknown Source)
at com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.getTimestamp(WSJdbcResultSet.java:1914)
Environment
4.9.0.
To Reproduce
Steps to reproduce the behavior:
Perform persistence operations with a lot of threads.
Expected behavior
No exceptions and correct date-time
Additional context
We have seen this rarely and only with Derby during testing. But the safe use of the Calendar object depends on how the underlying driver works, so it needs to be fixed for everything. Lesson: don't trust an API to not mutate an object you pass in. Make it immutable.
The text was updated successfully, but these errors were encountered:
hi @zachyf this issue was marked as resolved in September of 2021. I suggest opening a new issue or providing more information about exactly what you're seeing... e.g. which version of FHIR Server
Describe the bug
Calendar is not thread-safe, so the following DAO call can lead to issues because UTC_CALENDAR is declared as static (and therefore shared by multiple threads):
Similarly:
For Derby, we have seen the following error:
java.lang.ArrayIndexOutOfBoundsException: Array index out of range: -602
at java.base/sun.util.calendar.BaseCalendar.getCalendarDateFromFixedDate(BaseCalendar.java:453)
at java.base/java.util.GregorianCalendar.computeFields(GregorianCalendar.java:2394)
at java.base/java.util.GregorianCalendar.computeTime(GregorianCalendar.java:2815)
at java.base/java.util.Calendar.updateTime(Calendar.java:3428)
at java.base/java.util.Calendar.getTimeInMillis(Calendar.java:1812)
at org.apache.derby.iapi.types.SQLTimestamp.getTimestamp(Unknown Source)
at org.apache.derby.impl.jdbc.EmbedResultSet.getTimestamp(Unknown Source)
at com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.getTimestamp(WSJdbcResultSet.java:1914)
Environment
4.9.0.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No exceptions and correct date-time
Additional context
We have seen this rarely and only with Derby during testing. But the safe use of the Calendar object depends on how the underlying driver works, so it needs to be fixed for everything. Lesson: don't trust an API to not mutate an object you pass in. Make it immutable.
The text was updated successfully, but these errors were encountered: