DDC-2960: Second level cache fatal error on assocations #3684

Closed
opened 2026-01-22 14:25:18 +01:00 by admin · 6 comments
Owner

Originally created by @doctrinebot on GitHub (Feb 6, 2014).

Jira issue originally created by user goetas:

After the first request, that puts in cache the entities, i get a fatal error:

Fatal error: Call to undefined method Doctrine\ORM\Persisters\BasicEntityPersister::getCacheRegion() in /vagrant/project/mercurio-rest/vendor/doctrine/orm/lib/Doctrine/ORM/Cache/DefaultEntityHydrator.php on line 128

I have also posted a question that explain it with a example:
http://stackoverflow.com/questions/21577001/doctrine-second-level-cache-fatal-error-without-cache-on-entity

I don't know if is really related to @Cache annotation...

The fact is that $assocPersister (https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Cache/DefaultEntityHydrator.php#L127) is not a CachedPersister instance.

Originally created by @doctrinebot on GitHub (Feb 6, 2014). Jira issue originally created by user goetas: After the first request, that puts in cache the entities, i get a fatal error: `Fatal error: Call to undefined method Doctrine\ORM\Persisters\BasicEntityPersister::getCacheRegion() in /vagrant/project/mercurio-rest/vendor/doctrine/orm/lib/Doctrine/ORM/Cache/DefaultEntityHydrator.php on line 128` I have also posted a question that explain it with a example: http://stackoverflow.com/questions/21577001/doctrine-second-level-cache-fatal-error-without-cache-on-entity I don't know if is really related to @Cache annotation... The fact is that `$assocPersister` (https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Cache/DefaultEntityHydrator.php#L127) is not a `CachedPersister` instance.
admin added the Bug label 2026-01-22 14:25:18 +01:00
admin closed this issue 2026-01-22 14:25:18 +01:00
Author
Owner

@doctrinebot commented on GitHub (Feb 6, 2014):

Comment created by goetas:

It happens when an entity is used as id fileld

@doctrinebot commented on GitHub (Feb 6, 2014): Comment created by goetas: It happens when an entity is used as id fileld
Author
Owner

@doctrinebot commented on GitHub (Feb 7, 2014):

Comment created by @FabioBatSilva:

You have to add @Cache to all associated entities.

@doctrinebot commented on GitHub (Feb 7, 2014): Comment created by @FabioBatSilva: You have to add `@Cache` to all associated entities.
Author
Owner

@doctrinebot commented on GitHub (Feb 7, 2014):

Comment created by goetas:

it is a little bit redundant... but acceptable... (is it used to discover in which region save the entity?)

I have tried to put @cache annotations, but when the entity has an association key, it results partially populated (just the primary key).

Anyway, a fatal error is a wrong user experience... it can be fixed

@doctrinebot commented on GitHub (Feb 7, 2014): Comment created by goetas: it is a little bit redundant... but acceptable... (is it used to discover in which region save the entity?) I have tried to put @cache annotations, but when the entity has an association key, it results partially populated (just the primary key). Anyway, a fatal error is a wrong user experience... it can be fixed
Author
Owner

@doctrinebot commented on GitHub (Feb 12, 2014):

Comment created by goetas:

I think that this was fixed here 7e5a1c6b0d (diff-9f61d3a7fb0439833d89e2d120d298bc)
Probably i have not merged the latest master.

@doctrinebot commented on GitHub (Feb 12, 2014): Comment created by goetas: I think that this was fixed here https://github.com/doctrine/doctrine2/commit/7e5a1c6b0d928a63626fea961dd4cecb74ab01de#diff-9f61d3a7fb0439833d89e2d120d298bc Probably i have not merged the latest master.
Author
Owner

@doctrinebot commented on GitHub (Feb 12, 2014):

Comment created by goetas:

Already fixed with 7e5a1c6b0d (diff-9f61d3a7fb0439833d89e2d120d298bc)

@doctrinebot commented on GitHub (Feb 12, 2014): Comment created by goetas: Already fixed with https://github.com/doctrine/doctrine2/commit/7e5a1c6b0d928a63626fea961dd4cecb74ab01de#diff-9f61d3a7fb0439833d89e2d120d298bc
Author
Owner

@doctrinebot commented on GitHub (Feb 12, 2014):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Feb 12, 2014): Issue was closed with resolution "Invalid"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#3684