spring-projects / spring-data-jpa

Simplifies the development of creating a JPA-based data access layer.

Home Page:https://spring.io/projects/spring-data-jpa/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid value for NanoOfSecond between 12am and 1am

mkubele opened this issue · comments

DateTimeException is thrown when select operation with entity that contains java.time.LocalTime is performed between 12am and 1am (00:00-01:00)
error message:

Invalid value for NanoOfSecond (valid values 0 - 999999999): -329000000
java.time.DateTimeException: Invalid value for NanoOfSecond (valid values 0 - 999999999): -329000000

note that the value is random.

demo project is available HERE
Steps to reproduce:

  • Set time on your machine between 00:00-01:00
  • Either run:
    • test unit test
    • docker-compose up -d and start the application

This sounds very much like a Hibernate issue, since all the JPA mapping and almost all of the conversions are done by it.
I recommend creating a reproducer based purely on Hibernate and submitting an issue with them.

If you think this is actually a Spring Data issue, please provide a reproducer for the issue including a test case that demonstrates the correct behaviour using the EntityManager directly.

I am not able to provide correct behaviour using the EntityManager in spring boot project, however it works in hibernate-only project, without springboot. Project available HERE
I tested it with Hibernate 6.5.0.CR2 and springboot 3.3.0-RC1, that uses the same Hibernate version.