DDC-3259: Second level & UnitOfWork inconsistencies #4032

Closed
opened 2026-01-22 14:34:04 +01:00 by admin · 10 comments
Owner

Originally created by @doctrinebot on GitHub (Aug 19, 2014).

Originally assigned to: @lcobucci on GitHub.

Jira issue originally created by user goetas:

Hi!

I have a lot of entities with entity associations as keys and I'm trying to use second level cache.

Looking at the method: UnitOfWork::createEntity($className, array $data, &$hints = array())

  • $className: contains the class name
  • $data: contains the raw data (the row coming from the database)

Enabling the second level cache, DefaultQueryCache::get calls the createEntity method passing a $data that contains object entities and some raw data (https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Cache/DefaultQueryCache.php#L155).

I think that DefaultQueryCache should not introduce a variant of $data and should create a compatible version of $data.

Originally created by @doctrinebot on GitHub (Aug 19, 2014). Originally assigned to: @lcobucci on GitHub. Jira issue originally created by user goetas: Hi! I have a lot of entities with entity associations as keys and I'm trying to use second level cache. Looking at the method: `UnitOfWork::createEntity($className, array $data, &$hints = array())` - `$className`: contains the class name - `$data`: contains the raw data (the row coming from the database) Enabling the second level cache, `DefaultQueryCache::get` calls the `createEntity` method passing a `$data` that contains object entities and some raw data (https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/Cache/DefaultQueryCache.php#L155). I think that `DefaultQueryCache` should not introduce a variant of `$data` and should create a compatible version of `$data`.
admin added the Improvement label 2026-01-22 14:34:04 +01:00
admin closed this issue 2026-01-22 14:34:04 +01:00
Author
Owner

@doctrinebot commented on GitHub (Aug 19, 2014):

Comment created by @ocramius:

[~goetas] do you have any example of where this may be happening?

@doctrinebot commented on GitHub (Aug 19, 2014): Comment created by @ocramius: [~goetas] do you have any example of where this may be happening?
Author
Owner

@doctrinebot commented on GitHub (Aug 19, 2014):

Comment created by goetas:

https://github.com/doctrine/doctrine2/pull/1114

This is the same branch of https://github.com/doctrine/doctrine2/pull/1113, plus this commit (bfbbb9123f) that simply involves the second level cache too.
Travis should fail soon.

@doctrinebot commented on GitHub (Aug 19, 2014): Comment created by goetas: https://github.com/doctrine/doctrine2/pull/1114 This is the same branch of https://github.com/doctrine/doctrine2/pull/1113, plus this commit (https://github.com/goetas/doctrine2/commit/bfbbb9123fd28f7fa053b76895eaa77e00095aa6) that simply involves the second level cache too. Travis should fail soon.
Author
Owner

@doctrinebot commented on GitHub (Aug 19, 2014):

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1114] was closed:
https://github.com/doctrine/doctrine2/pull/1114

@doctrinebot commented on GitHub (Aug 19, 2014): Comment created by @doctrinebot: A related Github Pull-Request [GH-1114] was closed: https://github.com/doctrine/doctrine2/pull/1114
Author
Owner

@doctrinebot commented on GitHub (Aug 19, 2014):

Comment created by goetas:

Here the failure https://travis-ci.org/doctrine/doctrine2/jobs/32972996#L402

@doctrinebot commented on GitHub (Aug 19, 2014): Comment created by goetas: Here the failure https://travis-ci.org/doctrine/doctrine2/jobs/32972996#L402
Author
Owner

@doctrinebot commented on GitHub (Oct 22, 2014):

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1113] was assigned:
https://github.com/doctrine/doctrine2/pull/1113

@doctrinebot commented on GitHub (Oct 22, 2014): Comment created by @doctrinebot: A related Github Pull-Request [GH-1113] was assigned: https://github.com/doctrine/doctrine2/pull/1113
Author
Owner

@doctrinebot commented on GitHub (Jan 18, 2015):

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1113] was closed:
https://github.com/doctrine/doctrine2/pull/1113

@doctrinebot commented on GitHub (Jan 18, 2015): Comment created by @doctrinebot: A related Github Pull-Request [GH-1113] was closed: https://github.com/doctrine/doctrine2/pull/1113
Author
Owner

@doctrinebot commented on GitHub (Jan 24, 2015):

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1113] was labeled:
https://github.com/doctrine/doctrine2/pull/1113

@doctrinebot commented on GitHub (Jan 24, 2015): Comment created by @doctrinebot: A related Github Pull-Request [GH-1113] was labeled: https://github.com/doctrine/doctrine2/pull/1113
Author
Owner

@doctrinebot commented on GitHub (Jan 24, 2015):

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1113] was labeled:
https://github.com/doctrine/doctrine2/pull/1113

@doctrinebot commented on GitHub (Jan 24, 2015): Comment created by @doctrinebot: A related Github Pull-Request [GH-1113] was labeled: https://github.com/doctrine/doctrine2/pull/1113
Author
Owner

@doctrinebot commented on GitHub (Feb 16, 2015):

Comment created by @doctrinebot:

A related Github Pull-Request [GH-1113] was closed:
https://github.com/doctrine/doctrine2/pull/1113

@doctrinebot commented on GitHub (Feb 16, 2015): Comment created by @doctrinebot: A related Github Pull-Request [GH-1113] was closed: https://github.com/doctrine/doctrine2/pull/1113
Author
Owner

@lcobucci commented on GitHub (Jan 20, 2017):

Looks like it was fixed on #1113 (which was merged manually).

@lcobucci commented on GitHub (Jan 20, 2017): Looks like it was fixed on #1113 (which was merged manually).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4032