Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-2764

Map path expression tests behave random

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.1.0
    • Component/s: build / infrastructure
    • Labels:
      None

      Description

      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).

      public class @Entity Division {
        private Map<Division, VicePresident> orga;
      }
      

      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.

        Attachments

          Activity

            People

            • Assignee:
              struberg Mark Struberg
              Reporter:
              struberg Mark Struberg
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: