Mark Struberg created OPENJPA-2764:
--------------------------------------

             Summary: 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
             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)

Reply via email to