-
Notifications
You must be signed in to change notification settings - Fork 602
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DateTimeParseException reading Instant column with Persistence 3.2 #28813
Comments
See EclipseLink Issue : 2191 |
I wasn't able to replicate this behavior using only JPA. io.openliberty.data.internal_fat_jpa (failure)Output[7/24/24, 10:54:18:056 CDT] 0000004f id=00000000 eclipselink.ps.sql 3 INSERT INTO WLPDemographicInfo (ID, COLLECTEDON, INTRAGOVERNMENTALDEBT, NUMFULLTIMEWORKERS, PUBLICDEBT) VALUES (?, ?, ?, ?, ?)
bind => [33, 2007-04-30T16:00:00Z, 3833110332444.19, 121090000, 5007058051986.64]
[7/24/24, 10:54:18:125 CDT] 0000004f id=00000000 eclipselink.ps.sql 3 SELECT ID, COLLECTEDON, INTRAGOVERNMENTALDEBT, NUMFULLTIMEWORKERS, PUBLICDEBT FROM WLPDemographicInfo WHERE (PUBLICDEBT BETWEEN ? AND ?) ORDER BY PUBLICDEBT
bind => [5.0E+12, 1.0E+13]
[7/24/24, 10:54:18:134 CDT] 0000004f id=00000000 eclipselink.ps 3 CWWKD0291W: Exception [EclipseLink-3002] (Eclipse Persistence Services - 5.0.0-B02.v202404111748): org.eclipse.persistence.exceptions.ConversionException
Exception Description: The object [2007-04-30 11:00:00.0], of class [class java.lang.String], from mapping [org.eclipse.persistence.mappings.DirectToFieldMapping[collectedOn-->WLPDemographicInfo.COLLECTEDON]] with descriptor [RelationalDescriptor(test.jakarta.data.jpa.web.DemographicInfo --> [DatabaseTable(WLPDemographicInfo)])], could not be converted to [class java.time.Instant].
Internal Exception: java.time.format.DateTimeParseException: Text '2007-04-30 11:00:00.0' could not be parsed at index 10 NotesLooks like something got corrupted. Eclipse link shows putting in the correct date/time com.ibm.ws.jpa.tests.jpa_32_fat (success)Output[7/24/24, 11:03:47:287 CDT] 00000048 eclipselink I CWWJP9990I: [eclipselink] EclipseLink, version: Eclipse Persistence Services - 5.0.0-B02.v202404111748
[7/24/24, 11:03:56:636 CDT] 00000048 id=00000000 eclipselink.sql 3 [eclipselink.sql] INSERT INTO DEMOGRAPHICINFO (ID, COLLECTEDON, INTRAGOVERNMENTALDEBT, NUMFULLTIMEWORKERS, PUBLICDEBT) VALUES (?, ?, ?, ?, ?)
bind => [4, 2007-04-30T16:00:00Z, 3833110332444.19, 121090000, 5007058051986.64]
[7/24/24, 11:03:56:704 CDT] 00000048 id=00000000 eclipselink.sql 3 [eclipselink.sql] SELECT ID, COLLECTEDON, INTRAGOVERNMENTALDEBT, NUMFULLTIMEWORKERS, PUBLICDEBT FROM DEMOGRAPHICINFO WHERE (PUBLICDEBT BETWEEN ? AND ?) ORDER BY PUBLICDEBT
bind => [5.0E+12, 1.0E+13]
[7/24/24, 11:03:56:710 CDT] 00000048 SystemOut O DemographicInfo from 2007-04-30T16:00:00Z NotesSame version of eclipselink, same JVM. CommitHere is the commit where I attempted to recreate this issue. |
@KyleAure Noted |
If something is being corrupted on the Jakarta Data path that is not obvious when trying to reproduce, can EclipseLink logging/trace be enabled while reproducing in Jakarta Data such that the same sequence of JPA operations leading up to the error can be used to reproduce in pure JPA? |
I can tell you that the tests are still failing if I try to enable them:
Otherwise, my prior comment suggested that you enable EclipseLink logging while reproducing it via the Jakarta Data test to help figure out the exact code path that you need on the JPA/EclipseLink side for reproducing the error. That was just an idea - you are welcome to try other approaches for debugging instead or in addition to that. I don't know of anything that you should be waiting on Kyle or I for. |
I haven't done any additional investigation into this issue after the initial attempt to re-create the issue. |
Describe the bug
When Persistence 3.2 is used to query for an entity that has an attribute of type Instant, it gets a DateTimeParseException.
See test.jakarta.data.jpa.web.DemographicInfo, which has this attribute:
and the following JPQL which read entities of that type:
The following exception is raised:
Steps to Reproduce
Re-enable test.jakarta.data.jpa.web.DataJPATestServlet.testBigDecimal() and test.jakarta.data.jpa.web.DataJPATestServlet.testBigInteger(), which, despite their names, are also testing Instant. These had to be disabled when switching the server.xml from persistence-3.1 to persistence-3.2.
Expected behavior
Successful retrieval of the entity, as happens with Persistence 3.1.
Diagnostic information:
The text was updated successfully, but these errors were encountered: