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

Loading JAXB meta data when using MetaDataRepository preloading isn't thead safe.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0, 2.1.0
    • Fix Version/s: 2.1.0
    • Component/s: kernel
    • Labels:
      None

      Description

      This problem was originally reported in OPENJPA-1631 where a NPE was fixed, but this JIRA will be used to fix the root problem.

        Issue Links

          Activity

          Hide
          mikedd Michael Dick added a comment -

          Closing issues which have been resolved for some time. If the problem persists, please reopen.

          Show
          mikedd Michael Dick added a comment - Closing issues which have been resolved for some time. If the problem persists, please reopen.
          Hide
          curtisr7 Rick Curtis added a comment -

          Committed revision 940093 to trunk.

          Show
          curtisr7 Rick Curtis added a comment - Committed revision 940093 to trunk.
          Hide
          fancy Catalina Wei added a comment -

          1. NULL pointer check for 'cls' the following code block:

          + // Preload XML MetaData
          + for(Class<?> cls : loaded){
          + ClassMetaData cmd = getCachedMetaData(cls);
          + getXMLMetaData(cls);
          + for(FieldMetaData fmd : cmd.getFields())

          { + getXMLMetaData(fmd.getDeclaredType()); + }

          + }

          2. please verify the patch passes JUnit test TestXMLCustomerOrder in org.apache.openjpa.persistence.xmlmapping.query.
          I can not recall the rational behaind the method signature of
          getXMLMetaData(FieldMetaData fmd) in AbstractExpresionBuilder.traversePath()

          If twith the path, TestXMLCustomerOrder passes, then it is OK to change the method signiture.

          Show
          fancy Catalina Wei added a comment - 1. NULL pointer check for 'cls' the following code block: + // Preload XML MetaData + for(Class<?> cls : loaded){ + ClassMetaData cmd = getCachedMetaData(cls); + getXMLMetaData(cls); + for(FieldMetaData fmd : cmd.getFields()) { + getXMLMetaData(fmd.getDeclaredType()); + } + } 2. please verify the patch passes JUnit test TestXMLCustomerOrder in org.apache.openjpa.persistence.xmlmapping.query. I can not recall the rational behaind the method signature of getXMLMetaData(FieldMetaData fmd) in AbstractExpresionBuilder.traversePath() If twith the path, TestXMLCustomerOrder passes, then it is OK to change the method signiture.
          Hide
          curtisr7 Rick Curtis added a comment -

          Attaching a patch that refactors some of the JAXB parsing code to allow for easier preloading. This seems safe enough, but I'm wonder if I missed something with my changes.

          Show
          curtisr7 Rick Curtis added a comment - Attaching a patch that refactors some of the JAXB parsing code to allow for easier preloading. This seems safe enough, but I'm wonder if I missed something with my changes.

            People

            • Assignee:
              curtisr7 Rick Curtis
              Reporter:
              curtisr7 Rick Curtis
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development