cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nikita Timofeev (Jira)" <j...@apache.org>
Subject [jira] [Updated] (CAY-2678) Inheritance warnings caused by unnecessary MappingCache creations during initialization
Date Fri, 02 Oct 2020 10:38:00 GMT

     [ https://issues.apache.org/jira/browse/CAY-2678?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Nikita Timofeev updated CAY-2678:
---------------------------------
    Fix Version/s: 4.2.M2
                   4.1.1

> Inheritance warnings caused by unnecessary MappingCache creations during initialization
> ---------------------------------------------------------------------------------------
>
>                 Key: CAY-2678
>                 URL: https://issues.apache.org/jira/browse/CAY-2678
>             Project: Cayenne
>          Issue Type: Bug
>          Components: Core Library
>    Affects Versions: 4.1
>            Reporter: Stefan S.
>            Priority: Minor
>             Fix For: 4.1.1, 4.2.M2
>
>
> 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:*
> {code:java}
> org.apache.cayenne.map.EntityResolver::addDataMap(...)
> {code}
> checks for duplicated names (checkForDuplicatedNames()), which queries the DB entities
via
> {code:java}
> EntityResolver::getDbEntity(...)
> {code}
> 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



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message