mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-41: Getting error with lazy loading via createQuery() followed by $em->flush() #49
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Oct 10, 2009).
Jira issue originally created by user crotalus:
Simple O-O relationship between \Entities\User and \Entities\Feed. Seems like there's a problem with not-yet lazy-loaded proxies and $em->flush().
Table-data
Code:
Error:
Warning: spl_object_hash() expects parameter 1 to be object, null given in /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/UnitOfWork.php on line 1010
Warning: spl_object_hash() expects parameter 1 to be object, null given in /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/UnitOfWork.php on line 566
Warning: ReflectionProperty::setValue() expects parameter 1 to be object, null given in /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/UnitOfWork.php on line 575
Warning: get_class() expects parameter 1 to be object, null given in /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/UnitOfWork.php on line 979
Fatal error: Uncaught exception 'ReflectionException' with message 'Class does not exist' in /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/Mapping/ClassMetadata.php:69
Stack trace:
#0 /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/Mapping/ClassMetadata.php(69): ReflectionClass->**construct(false)
#1 /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php(247): Doctrine\ORM\Mapping\ClassMetadata->**construct(false)
#2 /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php(177): Doctrine\ORM\Mapping\ClassMetadataFactory->_newClassMetadataInstance(false)
#3 /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php(115): Doctrine\ORM\Mapping\ClassMetadataFactory->_loadMetadata(false)
#4 /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/EntityManager.php(212): Doctrine\ORM\Mapping\ClassMetadataFactory->getMetadataFor(false)
#5 /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/UnitOfWork.php(979): Doctrine\ORM\EntityManager->getClassMetadata in /home/crotalus/src/Doctrine2-Dev/lib/Doctrine/ORM/Mapping/ClassMetadata.php on line 69
PostgreSQL log:
2009-10-10 16:32:58 CEST LOGG: execute pdo_stmt_000000000a283af8: SELECT u0_.id AS id0 FROM users_debug u0_ WHERE u0_.id = 361
2009-10-10 16:32:58 CEST LOGG: sats: DEALLOCATE pdo_stmt_000000000a283af8
2009-10-10 16:32:58 CEST LOGG: execute pdo_stmt_000000000a283af8: SELECT NEXTVAL('feeds_debug_id_seq')
2009-10-10 16:32:58 CEST LOGG: sats: DEALLOCATE pdo_stmt_000000000a283af8
2009-10-10 16:32:58 CEST LOGG: execute pdo_stmt_000000000a283af8: SELECT NEXTVAL('users_debug_id_seq')
2009-10-10 16:32:58 CEST LOGG: sats: DEALLOCATE pdo_stmt_000000000a283af8
@doctrinebot commented on GitHub (Oct 12, 2009):
Comment created by romanb:
Strange, all the warnings and errors and the stack trace rather indicate that the associated value is NULL and not a (not initialized) proxy object. I'm working on this and already found an issue to address but I'm still unable to exactly reproduce this. Will keep you updated. If you have any further information, please let me know.
@doctrinebot commented on GitHub (Oct 12, 2009):
Comment created by romanb:
OK, managed to reproduce this. Working on it.
@doctrinebot commented on GitHub (Oct 12, 2009):
Comment created by romanb:
This should now be fixed but you need to manually delete your proxy classes so that they're regenerated. More improvements to the proxy classes and CLI tasks for (re)generating proxy classes will follow.
@doctrinebot commented on GitHub (Oct 12, 2009):
Issue was closed with resolution "Fixed"