OpenLiberty / open-liberty

Open Liberty is a highly composable, fast to start, dynamic application server runtime environment
https://openliberty.io
Eclipse Public License 2.0
1.14k stars 583 forks source link

Sorting not honored with JPA and Db2 #28289

Open mswatosh opened 2 months ago

mswatosh commented 2 months ago

When running a Jakarta Data test against Db2 there is an issue with sorting not always being honored. To recreate, remove the @SkipIfSysProp(DB_DB2) in DataTest.java (/io.openliberty.data.internal_fat/fat/src/test/jakarta/data/DataTest.java)

    @Test
    @SkipIfSysProp(DB_DB2) //Failing on Db2 due to eclipselink issue.
    public void testFindAndDeleteReturnsObjects() throws Exception {

This individual test can be run against Db2 with the following command: ./gradlew io.openliberty.data.internal_fat:buildandrun -Dfat.test.class.name=test.jakarta.data.web.DataTest -Dfat.test.method.name=testFindAndDeleteReturnsObjects -Dfat.bucket.db.type=DB2

The test should fail because a Package with id 70077 is returned first when Package with id 70071 should be returned first.

I was able to recreate this with just JPA here: https://github.com/mswatosh/persistence-recreates/blob/89d7083a370f9ce04884400661d6f35a07c4b47b/src/main/java/com/example/application/PersistenceService.java#L93

Riva-Tholoor-Philip commented 3 weeks ago

See EclipseLink Issue : 2194