ArrayIndexOutOfBoundsException when converting SQLite Timestamps to java.time.Instant

Description

We have a setup where we read Timestamps from a SQLite database and convert them to java.time.Instant.

This works fine, but we discovered that when we do this for parallel requests, random ArrayIndexOutOfBoundsExceptions occur.

This is further documented and discussed in my StackOverflow post: Stackoverflow Post

 

The culprit seems to be this class: , where a shared Calendar instance is passed to rs.getTimestamp.

 

Hibernate Version: 6.4.4 (provided by SpringBoot 3.2.5)

SQLite Version: 3.43.2.0 (provided by SpringBoot 3.2.5)

Table Create statement (abbreviated for readability):

Java Entity

Stacktrace

Activity

Show:

Manuel Rasinger February 25, 2025 at 2:38 PM

I did not manage to create a minimal example, but we encountered the issue again today in our application. If you want we can have a meeting and I can show you the setup?

Tử Song November 12, 2024 at 9:30 AM

Hi could you help to provide a real-small-reproduce-able code?

I tried thiss but could not see your mentioned issue:

Manuel Rasinger July 30, 2024 at 8:55 AM

I don’t know if it is useful to you, but I added our temporary solution to the SO post:

Holger Partsch July 2, 2024 at 8:42 AM
Edited

We face the same issue on a different database (HANA). I agree with the previous analysis that this is caused by using a static reference to a mutable Calendar instance in .

Details

Assignee

Reporter

Affects versions

Priority

Created June 6, 2024 at 11:51 AM
Updated February 25, 2025 at 2:38 PM