OpenJPA
  1. OpenJPA
  2. OPENJPA-1905

jar-file validation should be deferred until after OpenJPA is confirmed to be the application's chosen provider

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.0, 1.2.1, 1.2.2, 2.0.0, 2.0.1
    • Fix Version/s: 1.2.3, 2.0.2, 2.1.0, 2.2.0
    • Component/s: usability, validation
    • Labels:
      None

      Description

      While processing a persistence-unit definition in persistence.xml requested by an invocation of PersistenceProvider.createEntityManagerFactory(), validation of elements such as <jar-file> take place during the execution of the SAXParser. If an entry named by the element does not exist, a GeneralException originating from the SAXException fails the createEMF() operation – the expected and correct behavior in such a situation.

      However, this validation occurs before OpenJPA checks to see if it is the JPA Provider requested by the Application. This means that OpenJPA throws this Exception regardless to the fact that the PU may have defined a <persistence> element requesting a JPA provider other then OpenJPA – instead of returning the expected null value as expected by the contract.

      Thus, there needs to be a change where the first item validated is the requested provider, immediately returning null as per JPA Spec contract if OpenJPA is not the requested provider. This would cause the error in the scenario described above to be reported by the requested JPA provider, instead of short-circuiting the process as can happen currently.

        Activity

        Jody Grassel made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Fixed [ 1 ]
        Michael Dick made changes -
        Resolution Fixed [ 1 ]
        Status Resolved [ 5 ] Reopened [ 4 ]
        Michael Dick made changes -
        Fix Version/s 2.2.0 [ 12315910 ]
        Michael Dick made changes -
        Status In Progress [ 3 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Michael Dick made changes -
        Fix Version/s 1.2.3 [ 12314517 ]
        Fix Version/s 2.0.2 [ 12315257 ]
        Fix Version/s 2.1.0 [ 12314542 ]
        Jody Grassel made changes -
        Field Original Value New Value
        Status Open [ 1 ] In Progress [ 3 ]
        Jody Grassel created issue -

          People

          • Assignee:
            Jody Grassel
            Reporter:
            Jody Grassel
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development