DDC-1520: UnitOfWork->triggerEagerLoads raises SqlException #1908

Closed
opened 2026-01-22 13:30:30 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Dec 6, 2011).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user h-andreas:

If all entities that are marked to be loaded eagerly are loaded through other references before UnitOfWork->triggerEagerLoads is executed an exception will be thrown as the value of the array is empty.

    public function triggerEagerLoads()
    {
        if (!$this->eagerLoadingEntities) {
            return;
        }

        // avoid infinite recursion
        $eagerLoadingEntities = $this->eagerLoadingEntities;
        $this->eagerLoadingEntities = array();

        foreach ($eagerLoadingEntities AS $entityName => $ids) {
            $class = $this->em->getClassMetadata($entityName);
            $this->getEntityPersister($entityName)->loadAll(array*combine($class->identifier, array(array*values($ids))));
        }
    }
Originally created by @doctrinebot on GitHub (Dec 6, 2011). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user h-andreas: If all entities that are marked to be loaded eagerly are loaded through other references before UnitOfWork->triggerEagerLoads is executed an exception will be thrown as the value of the array is empty. ``` public function triggerEagerLoads() { if (!$this->eagerLoadingEntities) { return; } // avoid infinite recursion $eagerLoadingEntities = $this->eagerLoadingEntities; $this->eagerLoadingEntities = array(); foreach ($eagerLoadingEntities AS $entityName => $ids) { $class = $this->em->getClassMetadata($entityName); $this->getEntityPersister($entityName)->loadAll(array*combine($class->identifier, array(array*values($ids)))); } } ```
admin added the Bug label 2026-01-22 13:30:30 +01:00
admin closed this issue 2026-01-22 13:30:31 +01:00
Author
Owner

@doctrinebot commented on GitHub (Dec 13, 2011):

Comment created by @beberlei:

Fixed.

@doctrinebot commented on GitHub (Dec 13, 2011): Comment created by @beberlei: Fixed.
Author
Owner

@doctrinebot commented on GitHub (Dec 13, 2011):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Dec 13, 2011): 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#1908