Collection cache key? #7101

Closed
opened 2026-01-22 15:44:41 +01:00 by admin · 0 comments
Owner

Originally created by @meiyasan on GitHub (Jan 26, 2023).

Hello,

There are many subtleties in doctrine that I don't understand.
But why the collection cache is based on an key that involve rootEntityName ?

For instance how does it works in the following case:

#[Entity] // <--- Some entity declaration using discrimination map
class CommonClass {}

class ExtendedClassA extends CommonClass
{
      #[ManyToOne...]
      protected $attribute;
}

class ExtendedClassB extends CommonClass
{
      #[ManyToOne...]
      protected $attribute;
}

The code below should be computing a key that is something like : "commonClass_XX_attribute" in both cases and so this might conflict right ? (I am looking for a second level cache issue in one application and that's how I end up here)

ed56f42cd5/lib/Doctrine/ORM/Cache/Persister/Entity/AbstractEntityPersister.php (L610)

This is actually same for timestampKey, right ?
ed56f42cd5/lib/Doctrine/ORM/Cache/Persister/Entity/AbstractEntityPersister.php (L97)

Thank you for your help :o)

Originally created by @meiyasan on GitHub (Jan 26, 2023). Hello, There are many subtleties in doctrine that I don't understand. But why the collection cache is based on an key that involve `rootEntityName` ? For instance how does it works in the following case: ``` #[Entity] // <--- Some entity declaration using discrimination map class CommonClass {} class ExtendedClassA extends CommonClass { #[ManyToOne...] protected $attribute; } class ExtendedClassB extends CommonClass { #[ManyToOne...] protected $attribute; } ``` The code below should be computing a key that is something like : "commonClass_XX_attribute" in both cases and so this might conflict right ? (I am looking for a second level cache issue in one application and that's how I end up here) https://github.com/doctrine/orm/blob/ed56f42cd50a17fd00f601d57912f41769123134/lib/Doctrine/ORM/Cache/Persister/Entity/AbstractEntityPersister.php#L610 This is actually same for timestampKey, right ? https://github.com/doctrine/orm/blob/ed56f42cd50a17fd00f601d57912f41769123134/lib/Doctrine/ORM/Cache/Persister/Entity/AbstractEntityPersister.php#L97 Thank you for your help :o)
admin closed this issue 2026-01-22 15:44:41 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#7101