[ https://issues.apache.org/jira/browse/OPENJPA-2764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16731852#comment-16731852 ]
ASF subversion and git services commented on OPENJPA-2764: ---------------------------------------------------------- Commit 260042ba5184f1f415f2f0975e3449f13611b84a in openjpa's branch refs/heads/master from Mark Struberg [ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=260042b ] OPENJPA-2764 fix tests with random behaviour The behaviour was random due to the undefined order in which real databases return data. > Map path expression tests behave random > --------------------------------------- > > Key: OPENJPA-2764 > URL: https://issues.apache.org/jira/browse/OPENJPA-2764 > Project: OpenJPA > Issue Type: Bug > Components: build / infrastructure > Affects Versions: 3.0.0 > Reporter: Mark Struberg > Assignee: Mark Struberg > Priority: Major > Fix For: 3.0.1 > > > Most of the tests under org.apache.openjpa.persistence.jdbc.maps behave > random when they test against a real database. > Those tests capture the JQPL path navigation for Maps (Covered in the spec in > 4.4.4.1). > {code} > public class @Entity Division { > private Map<Division, VicePresident> orga; > } > {code} > Such structures can be navitated via KEY(), VALUE(), and ENTRY(). > Our tests did create 2 Divisions with 2 orga entries. And using > {{query.getResultList().get(0)}} to verify the results. And this was exactly > the problem. using {{get(0)}} leads to random behaviour with real databases. > On the default Derby database it didn't make any difference as the result > from the index query was always in the order in which the data got written to > disk. But this is not guaranteed for performance tuned databases like > PostgreSQL, MariaDB and MySQL. In those cases we got random errors. -- This message was sent by Atlassian JIRA (v7.6.3#76005)