Cayenne
  1. Cayenne
  2. CAY-501

committing dependent relationships result in "Some parts of FK are missing in snapshot, join:" error

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 1.2 branch
    • Fix Version/s: 1.2 branch
    • Component/s: Core Library
    • Labels:
      None

      Description

      Committing dependent relationships result in "Some parts of FK are missing in snapshot, join:" error

      WOMS_WORK inherits from STATUSABLE_WORK which
      inherits from WORK. Ie, STATUSABLE_WORK's pk is dependent on WORK's pk, and WOMS_WORK's pk is dependent on STATUSABLE_WORK's pk. The relationship between WOMS_WORK and STATUSABLE_WORK is the join causing the error.

      Leftover new object: {<ObjectId:WomsWork, TEMP:000003BAA6970161>; new; [statusableWork=>

      {<ObjectId:StatusableWork, TEMP:000004BAA6970161>}

      ]}
      Leftover new object: {<ObjectId:StatusableWork, TEMP:000004BAA6970161>; new; [work=>

      {<ObjectId:Work, TEMP:000005BAA6970161>}

      ]}
      Leftover new object: {<ObjectId:Work, TEMP:000005BAA6970161>; new; [statusableWorkList=>

      {<ObjectId:StatusableWork, TEMP:000004BAA6970161>}

      ]}

      org.objectstyle.cayenne.CayenneRuntimeException: [v.1.2-dev April 10 2006] Some parts of FK are missing in snapshot, join: org.objectstyle.cayenne.map.DbJoin@9505f[source=WOMS_WORK_ID,target=ID]
      at org.objectstyle.cayenne.access.DataNodePKGenerationAction.appendPkFromMasterRelationships(DataNodePKGenerationAction.java:250)
      at org.objectstyle.cayenne.access.DataNodePKGenerationAction.createPermIdsForObjEntity(DataNodePKGenerationAction.java:143)
      at org.objectstyle.cayenne.access.DataNodeInsertBucket.createPrimaryKey(DataNodeInsertBucket.java:97)
      at org.objectstyle.cayenne.access.DataNodeFlushAction.createPK(DataNodeFlushAction.java:106)
      at org.objectstyle.cayenne.access.DataDomainFlushAction.preprocess(DataDomainFlushAction.java:217)
      at org.objectstyle.cayenne.access.DataDomainFlushAction.flush(DataDomainFlushAction.java:148)
      at org.objectstyle.cayenne.access.DataDomain.onSyncFlush(DataDomain.java:778)
      at org.objectstyle.cayenne.access.DataDomain$2.transform(DataDomain.java:749)
      at org.objectstyle.cayenne.access.DataDomain.runInTransaction(DataDomain.java:804)
      at org.objectstyle.cayenne.access.DataDomain.onSync(DataDomain.java:746)
      at org.objectstyle.cayenne.access.DataContext.flushToParent(DataContext.java:1217)
      at org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:1121)

      See thread http://objectstyle.org/cayenne/lists/cayenne-user/2006/04/0106.html for details.

        Activity

        Hide
        Mike Kienenberger added a comment -

        Works for me. Thanks.

        Show
        Mike Kienenberger added a comment - Works for me. Thanks.
        Hide
        Mike Kienenberger added a comment -

        Well, an API freeze should be subservient to fixing known regressions

        Yes, I'll give this a try in a few minutes.

        Show
        Mike Kienenberger added a comment - Well, an API freeze should be subservient to fixing known regressions Yes, I'll give this a try in a few minutes.
        Hide
        Andrus Adamchik added a comment -

        Fixed. Had to move EntitySorter to the DataDomain level which was tough considering declared API freeze.

        Mike, your example no longer produces errors. Can you try it out yourself?

        Show
        Andrus Adamchik added a comment - Fixed. Had to move EntitySorter to the DataDomain level which was tough considering declared API freeze. Mike, your example no longer produces errors. Can you try it out yourself?
        Hide
        Andrus Adamchik added a comment -

        I can confirm that this is a sorter issue - cross-node sorting to be more specific. The latest refactoring of the commit stack pushed a number of operations to the DataNode level that should have remained at the DataDomain level and span all nodes participating in commit. I'll be working on a more robust commit algorithm.

        Show
        Andrus Adamchik added a comment - I can confirm that this is a sorter issue - cross-node sorting to be more specific. The latest refactoring of the commit stack pushed a number of operations to the DataNode level that should have remained at the DataDomain level and span all nodes participating in commit. I'll be working on a more robust commit algorithm.
        Hide
        Mike Kienenberger added a comment -

        By the way, I'm successfully using M11 so far, so this isn't personally a critical issue providing I don't hit any other blockers in M11.

        Show
        Mike Kienenberger added a comment - By the way, I'm successfully using M11 so far, so this isn't personally a critical issue providing I don't hit any other blockers in M11.
        Hide
        Andrus Adamchik added a comment -

        Great, this confirm my suspicions about the cause of it. I'll take a look at it tomorrow.

        Show
        Andrus Adamchik added a comment - Great, this confirm my suspicions about the cause of it. I'll take a look at it tomorrow.
        Hide
        Mike Kienenberger added a comment -

        Looks like it broke between M11 and M12. Works M9 through M11, but breaks on M12, B1, and current.

        Show
        Mike Kienenberger added a comment - Looks like it broke between M11 and M12. Works M9 through M11, but breaks on M12, B1, and current.
        Hide
        Mike Kienenberger added a comment -

        I've successfully tested this with a 2005-10-17 cayenne build (not sure exactly which 1.2 milestone that it was).

        So this is a regression.

        Show
        Mike Kienenberger added a comment - I've successfully tested this with a 2005-10-17 cayenne build (not sure exactly which 1.2 milestone that it was). So this is a regression.
        Hide
        Mike Kienenberger added a comment -

        Probably should have noted that the demo zip unpacks as a "demo" java package location – just add "demo" into your classpath.

        Show
        Mike Kienenberger added a comment - Probably should have noted that the demo zip unpacks as a "demo" java package location – just add "demo" into your classpath.
        Hide
        Mike Kienenberger added a comment -

        Here's a revised model (changed packaging) and demo code.
        I think this is everything needed to reproduce the problem.

        Show
        Mike Kienenberger added a comment - Here's a revised model (changed packaging) and demo code. I think this is everything needed to reproduce the problem.
        Hide
        Mike Kienenberger added a comment -

        Model demonstrating problem

        Show
        Mike Kienenberger added a comment - Model demonstrating problem

          People

          • Assignee:
            Andrus Adamchik
            Reporter:
            Mike Kienenberger
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development