Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

second-level-cache, entity-hydrator throws exception #5808

Closed
floriansemm opened this issue May 4, 2016 · 9 comments
Closed

second-level-cache, entity-hydrator throws exception #5808

floriansemm opened this issue May 4, 2016 · 9 comments
Assignees
Milestone

Comments

@floriansemm
Copy link

I have the following entity:

/**
 * Geoinformation
 *
 * @ORM\Table(...)
 * @ORM\Entity(...)
 * @ORM\Cache(usage="NONSTRICT_READ_WRITE", region="geoinformation_region")
 */
class Geoinformation
{
    // more properties

    /**
     * @var GeoinformationMetaData
     *
     * @ORM\OneToOne(targetEntity="AppBundle\Entity\GeoinformationMetaData", inversedBy="geoinformation", cascade={"persist"})
     * @ORM\JoinColumn(name="geoinformation_meta_data_id", referencedColumnName="id")
     * @ORM\Cache(usage="NONSTRICT_READ_WRITE", region="geoinformation_region")
     */
    private $metaData;
}

Creating and persisting of new GeoinformationMetaData objects works fine. When I query the database I get the following error:

Uncaught PHP Exception Symfony\Component\Debug\Exception\ContextErrorException: "Notice: Undefined index: targetToSourceKeyColumns" at /project/vendor/doctrine/orm/lib/Doctrine/ORM/Cache/DefaultEntityHydrator.php line 106 {"exception":"[object] (Symfony\\Component\\Debug\\Exception\\ContextErrorException(code: 0): Notice: Undefined index: targetToSourceKeyColumns at /project/vendor/doctrine/orm/lib/Doctrine/ORM/Cache/DefaultEntityHydrator.php:106

I use doctrine v2.5.4 with symfony v3.0.5.

@okwinza
Copy link

okwinza commented Jun 24, 2016

same thing with enabled second level cache, sf 2.8.7, doctrine 2.5.4

Any ideas?

@FabioBatSilva FabioBatSilva self-assigned this Jun 24, 2016
@Ocramius
Copy link
Member

Does this also affect master?
On Jun 24, 2016 04:19, "Oleg Krasavin" notifications@github.com wrote:

same thing with enabled second level cache, sf 2.8.7, doctrine 2.5.4

Any ideas?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#5808 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAJakK8PAq-MLS0k0KHCJ6Wx9cj0XMmuks5qOz6igaJpZM4IW-VO
.

@okwinza
Copy link

okwinza commented Jun 24, 2016

Master seems fine.

@Ocramius
Copy link
Member

Can anyone verify what commit fixes this issue, and link it up with what this issue duplicates?

@Ocramius Ocramius added this to the 2.6.0 milestone Jul 12, 2016
@yceruto
Copy link
Contributor

yceruto commented Jul 12, 2016

@floriansemm, @okwinza the "Association cache definition" documentation has a note:

Note: for this to work, the target entity must also be marked as cacheable.

Please, you could to check if this error still occurs adding @ORM\Cache(usage="NONSTRICT_READ_WRITE", region="geoinformation_region") to AppBundle\Entity\GeoinformationMetaData target entity ??

@Majkl578
Copy link
Contributor

Majkl578 commented Jul 12, 2016

Repro test case here: https://gist.github.com/Majkl578/61731254ea9d36f2f32778d357ff4f5b
Bisected fix to commit e64f44e (doesn't apply cleanly to 2.5.4 though) which refers to #1555.

@floriansemm
Copy link
Author

@yceruto the error was caused by an other relation. Everything is fine now.

@lcobucci
Copy link
Member

@yceruto the error was caused by an other relation. Everything is fine now.

Does it means that this issue can be closed?

@Ocramius
Copy link
Member

Ocramius commented Feb 7, 2017

Closing as duplicate of #6124 unless anybody can create a different failing test scenario (in such case, I'll re-open).

@Ocramius Ocramius closed this as completed Feb 7, 2017
@Ocramius Ocramius assigned Ocramius and unassigned FabioBatSilva Feb 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants