spring-projects / spring-data-jpa

Simplifies the development of creating a JPA-based data access layer.
https://spring.io/projects/spring-data-jpa/
Apache License 2.0
2.92k stars 1.39k forks source link

Invalid value for NanoOfSecond between 12am and 1am #3475

Open mkubele opened 1 month ago

mkubele commented 1 month ago

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:

schauder commented 1 month ago

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.

mkubele commented 1 month ago

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.