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

Open
opened 2026-01-22 14:58:50 +01:00 by admin · 0 comments
Owner

Originally created by @floriansemm on GitHub (May 4, 2016).

Originally assigned to: @Ocramius on GitHub.

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.

Originally created by @floriansemm on GitHub (May 4, 2016). Originally assigned to: @Ocramius on GitHub. I have the following entity: ``` php /** * 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`.
admin added the BugDuplicate labels 2026-01-22 14:58:50 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#5117