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

          Rick Curtis created issue -
          Rick Curtis made changes -
          Field Original Value New Value
          Link This issue is related to OPENJPA-1631 [ OPENJPA-1631 ]
          Rick Curtis made changes -
          Component/s kernel [ 12311302 ]
          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.
          Rick Curtis made changes -
          Attachment OPENJPA-1634.patch [ 12442336 ]
          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.
          Rick Curtis made changes -
          Fix Version/s 2.1.0 [ 12314542 ]
          Affects Version/s 2.0.0 [ 12314019 ]
          Affects Version/s 2.1.0 [ 12314542 ]
          Hide
          Rick Curtis added a comment -

          Committed revision 940093 to trunk.

          Show
          Rick Curtis added a comment - Committed revision 940093 to trunk.
          Rick Curtis made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          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.
          Michael Dick made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          12d 3h 37m 1 Rick Curtis 01/May/10 20:01
          Resolved Resolved Closed Closed
          141d 20h 38m 1 Michael Dick 20/Sep/10 16:39

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Development