Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-2678

Inheritance warnings caused by unnecessary MappingCache creations during initialization

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 4.1
    • Fix Version/s: 4.1.1, 4.2.M3
    • Component/s: Core Library
    • Labels:
      None

      Description

      In my case, a lot of warnings labeled "No super entity mapping for 'superOEName'" floods the log during Cayenne start-up. The project consists of multiple DataMaps, where some object entities in early loaded DataMaps are derived from object entities declared in DataMaps loaded later. Although the MappingCache is refreshed after all DataMaps are loaded, a cache instance is created / accessed while adding DataMaps (see call stack below).

       

      In Detail:

      org.apache.cayenne.map.EntityResolver::addDataMap(...)
      

      checks for duplicated names (checkForDuplicatedNames()), which queries the DB entities via

      EntityResolver::getDbEntity(...)
      

      EntityResolver::getDbEntity(...) resolves the entity from the MappingCache instance, which contains only DataMaps loaded so far. The cache tries to fully resolve the object entities including their inheritance tree, which is not yet available due to DataMaps loaded at a later point in time.

       

      Resolution Proposal:

      Decoupling of entity resolution for duplicate name checks during DataMap loading from building the cache with fully resolved object entities after all DataMaps have been loaded.

       

      Call-Stack:

      Thread [AWT-EventQueue-0] (Suspended (breakpoint at line 112 in MappingCache)) Thread [AWT-EventQueue-0] (Suspended (breakpoint at line 112 in MappingCache)) owns: EntityResolver$1  (id=1307) owns: EntityResolver  (id=68) MappingCache.index() line: 112 MappingCache.<init>(Collection<DataMap>) line: 65 EntityResolver$1.createDelegate() line: 417 EntityResolver$1.createDelegate() line: 413 EntityResolver$1(ProxiedMappingNamespace).getDelegate() line: 38 EntityResolver$1(ProxiedMappingNamespace).getDbEntity(String) line: 69 EntityResolver.getDbEntity(String) line: 255 EntityResolver.checkForDuplicatedNames(DataMap) line: 375 EntityResolver.addDataMap(DataMap) line: 360 ProjectController.updateEntityResolver() line: 313 ProjectController.setProject(Project) line: 303 CayenneModelerController.projectOpenedAction(Project) line: 207 OpenProjectAction.openProjectResourse(Resource, CayenneModelerController) line: 184 OpenProjectAction.openProject(File) line: 175 Main$1.run() line: 100

        Attachments

          Activity

            People

            • Assignee:
              ntimofeev Nikita Timofeev
              Reporter:
              sITo Stefan S.
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: