Skip to content

Loading…

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

Closed
doctrinebot opened this Issue · 6 comments

1 participant

@doctrinebot

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

@doctrinebot

Comment created by @beberlei:

assigned to Fabio

@doctrinebot

Comment created by @FabioBatSilva:

Can you please attached your entities ?

@doctrinebot

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

Comment created by @FabioBatSilva:

Fixed by : 960fbfc

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added this to the 2.5 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.