glassfish
  1. glassfish
  2. GLASSFISH-757

Error in Fetch Joins 1x1 with Query Language

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 9.1pe
    • Fix Version/s: 9.0pe
    • Component/s: entity-persistence
    • Labels:
      None
    • Environment:

      Operating System: Solaris
      Platform: Sun

    • Issuezilla Id:
      757
    • Status Whiteboard:
      Hide

      LOW

      Show
      LOW

      Description

      AS9.1PE Build7

      The fetchjoin_1x1 test failed in AS9.1PE Build7.

      The query is "SELECT Object(c) from Customer c JOIN FETCH c.spouse".

      The related AS server.log is given below,
      [#|2006-06-19T17:56:24.453-0700|FINE|sun-appserver-pe9.1|oracle.toplink.
      essentials.file:/data/AS91B7P/domains/domain1/applications/j2ee-apps/
      ejb30-ejbqlApp/ejb30-ejbql-par.jar-em.sql|_ThreadID=18;_ThreadName=p:
      thread-pool-1; w: 15;ClassName=null;MethodName=null;
      _RequestID=df8af119-36f2-4ad4-9722-7c6dc4956a4b;|
      SELECT t0.ID, t0.NAME, t0.FK5_FOR_CUSTOMER_TABLE, t0.CODE,
      t0.COUNTRY, t0.FK6_FOR_CUSTOMER_TABLE, t1.ID, t1.SOCSECNUM,
      t1.FIRSTNAME, t1.LASTNAME, t1.MAIDENNAME, t1.FK_FOR_INFO_TABLE,
      t1.FK7_FOR_CUSTOMER_TABLE FROM CUSTOMER_TABLE t0,
      SPOUSE_TABLE t1 WHERE (t1.FK7_FOR_CUSTOMER_TABLE = t0.ID)|#]

      [#|2006-06-19T17:56:24.544-0700|WARNING|sun-appserver-pe9.1|
      oracle.toplink.essentials.file:/data/AS91B7P/domains/domain1/applications/
      j2ee-apps/ejb30-ejbqlApp/ejb30-ejbql-par.jar-em|_ThreadID=18;
      _ThreadName=p: thread-pool-1; w:
      15;_RequestID=df8af119-36f2-4ad4-9722-7c6dc4956a4b;|
      java.lang.NullPointerException
      at oracle.toplink.essentials.mappings.ForeignReferenceMapping.buildClone
      (ForeignReferenceMapping.java:128)
      ......
      #|2006-06-19T17:56:24.563-0700|INFO|sun-appserver-pe9.1|javax.enterprise.
      system.stream.out|_ThreadID=18;_ThreadName=p: thread-pool-1; w: 15;|
      Caught exception test_fetchjoin_1x1: java.lang.NullPointerException|#]

      This test passed in AS9PE FCS.

        Activity

        Hide
        marina vatkina added a comment -

        Please attach the test case that reproduces the problem.

        Show
        marina vatkina added a comment - Please attach the test case that reproduces the problem.
        Hide
        chris_delahunt added a comment -

        In the fetchjoin_1x1 case, this error is due to Customer objects having a
        bidirectional relationship to spouse. In the test setup, the spouse is
        assigned a customer, but the customer->spouse relationship is left as null.
        This is the cause of this exception, as the database is stating that the
        customer has a spouse but the object in the cache doesn't have one. Both
        directions in a bidirectional relationship need to be set which isn't
        happening. Setting the spouse on the customer at the same time as the spouse
        is assigned a customer will resolve the issue.

        This problem though will still need to be handled, as it might also occur if
        the data in the object model is stale - the database shows the customer having
        a spouse but the object model doesn't.

        Show
        chris_delahunt added a comment - In the fetchjoin_1x1 case, this error is due to Customer objects having a bidirectional relationship to spouse. In the test setup, the spouse is assigned a customer, but the customer->spouse relationship is left as null. This is the cause of this exception, as the database is stating that the customer has a spouse but the object in the cache doesn't have one. Both directions in a bidirectional relationship need to be set which isn't happening. Setting the spouse on the customer at the same time as the spouse is assigned a customer will resolve the issue. This problem though will still need to be handled, as it might also occur if the data in the object model is stale - the database shows the customer having a spouse but the object model doesn't.
        Hide
        marina vatkina added a comment -

        Reassigned

        Show
        marina vatkina added a comment - Reassigned
        Hide
        gfbugbridge added a comment -

        <BT6443448>

        Show
        gfbugbridge added a comment - <BT6443448>
        Hide
        pkrogh added a comment -

        Reprioritized based on BUG triage. P4 LOW.

        Show
        pkrogh added a comment - Reprioritized based on BUG triage. P4 LOW.
        Hide
        gfbugbridge added a comment -

        <BT6540681>

        Show
        gfbugbridge added a comment - <BT6540681>
        Hide
        chris_delahunt added a comment -

        This is the same as 2881 which is being worked on.

            • This issue has been marked as a duplicate of 2881 ***
        Show
        chris_delahunt added a comment - This is the same as 2881 which is being worked on. This issue has been marked as a duplicate of 2881 ***

          People

          • Assignee:
            tware
            Reporter:
            sherryshen
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: