mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
Amount classes on metadata mapping loading via loadClassMetadata decreased #6714
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SinErgy84 on GitHub (May 12, 2021).
Caution: this issue seems to be related to symfony/dependency-injection changes in https://github.com/symfony/dependency-injection/releases/tag/v4.4.17 because v4.4.16 works as expected
Hi!
I've encountered a problem since the symfony/dependency-injection update to v4.4.17. Maybe I'm wrong to write here, but my problem is related to the
loadClassMetadataevent from doctrine, so maybe somebody have some clues.I'm using a symfony subscriber to listen to the
loadClassMetadataevent, to collect some data from ClassMetadata like association mappings and their target entities, especially for abstract classes and their children.In my test case with symfony/dependency-injection v4.4.16 the amount of classes on which metadata mapping was loaded was much higher (340 objects in my case) than on v4.4.17 (120 objects). The amount decreased massively and not only the valid classes but their abstract parent classes are missing / are not parsed anymore.
Maybe it's a config setting I'm missing? Do someone else experienced odd behaviour or strange changes in his process?
I have already tried the search in both projects, but since the problem is elusive or due to a specific change, unfortunately I have not found anything so far. I'm very grateful for any hint.
@beberlei commented on GitHub (May 12, 2021):
Do you require all entities to e loaded? Then you must call
$entityManager->getMetadataFactory()->getAllMetadata();and the cache must be empty. otherwise the amount of loaded metadata is an implementation detail and depends on the request usage and the cache. Changes of this behavior in minor versions is expected, because there is no guarantee a request triggers this event.