DDC-2862: When update cached entitiy, entity lost OneToOne relationship #3573

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

Originally created by @doctrinebot on GitHub (Dec 18, 2013).

Jira issue originally created by user coollamer:

Second-level-cache

$driver = $em->find('CachedDoctrine\Entities\Driver', 1); //Get cached entity
dump($driver->getUserProfile()); //Return User
$driver->setName('Franta');
$em->flush();
$em->clear();

$driver = $em->find('CachedDoctrine\Entities\Driver', 1);
dump($driver->getUserProfile() ); //Return null

Originally created by @doctrinebot on GitHub (Dec 18, 2013). Jira issue originally created by user coollamer: Second-level-cache $driver = $em->find('CachedDoctrine\Entities\Driver', 1); //Get cached entity dump($driver->getUserProfile()); //Return User $driver->setName('Franta'); $em->flush(); $em->clear(); $driver = $em->find('CachedDoctrine\Entities\Driver', 1); dump($driver->getUserProfile() ); //Return null
admin added the Bug label 2026-01-22 14:22:55 +01:00
admin closed this issue 2026-01-22 14:22:55 +01:00
Author
Owner

@doctrinebot commented on GitHub (Dec 18, 2013):

Comment created by @beberlei:

assigned to Fabio

@doctrinebot commented on GitHub (Dec 18, 2013): Comment created by @beberlei: assigned to Fabio
Author
Owner

@doctrinebot commented on GitHub (Dec 18, 2013):

Comment created by @FabioBatSilva:

Can you please attached your entities ?

@doctrinebot commented on GitHub (Dec 18, 2013): Comment created by @FabioBatSilva: Can you please attached your entities ?
Author
Owner
@doctrinebot commented on GitHub (Dec 19, 2013): Comment created by coollamer: I attach the files. Is it from project: https://github.com/CoolLamer/CachedDoctrine files is from: https://github.com/CoolLamer/CachedDoctrine/blob/master/app/model/Entities/Driver.php https://github.com/CoolLamer/CachedDoctrine/blob/master/app/model/Entities/User.php
Author
Owner

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

Comment created by coollamer:

The entity is not stored in the cache until the parameter of its subordinate entities is loaded. Entities are same.

Example:
$driver = $em->find('CachedDoctrine\Entities\Driver', 1); //load from db
$em->clear();

$driver = $em->find('CachedDoctrine\Entities\Driver', 1); //again load from db
$driver->getUserProfile()->getName() //Access parametr
$em->clear();

$driver = $em->find('CachedDoctrine\Entities\Driver', 1); //now load from cache

@doctrinebot commented on GitHub (Jan 6, 2014): Comment created by coollamer: The entity is not stored in the cache until the parameter of its subordinate entities is loaded. Entities are same. Example: $driver = $em->find('CachedDoctrine\Entities\Driver', 1); //load from db $em->clear(); $driver = $em->find('CachedDoctrine\Entities\Driver', 1); //again load from db $driver->getUserProfile()->getName() //Access parametr $em->clear(); $driver = $em->find('CachedDoctrine\Entities\Driver', 1); //now load from cache
Author
Owner

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

Comment created by @FabioBatSilva:

Fixed by : 960fbfc110

@doctrinebot commented on GitHub (Feb 10, 2014): Comment created by @FabioBatSilva: Fixed by : https://github.com/doctrine/doctrine2/commit/960fbfc110b5d62a245eb6686f788e04c5019c2e
Author
Owner

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

Issue was closed with resolution "Fixed"

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

No dependencies set.

Reference: doctrine/archived-orm#3573