OpenJPA
  1. OpenJPA
  2. OPENJPA-1634

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

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major 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
          Michael Dick added a comment -

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

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

          Committed revision 940093 to trunk.

          Show
          Rick Curtis added a comment - Committed revision 940093 to trunk.
          Hide
          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
          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
          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
          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:
              Rick Curtis
              Reporter:
              Rick Curtis
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development