mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-2432: Entity can be initialized even if not found #3050
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 (May 6, 2013).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user croensch:
I have some data in loose consistency, trying to load a field from a certain entity will yield a EntityNotFoundException. Trying it again, for example if the group is reused in a set that gets iterated, will work but provide an empty/dirty Entity.
Thats probably because the proxies internal methods set isInitialized to true on the first try. Without reverting it in case of the exception...
Is there any reason to do that?
@doctrinebot commented on GitHub (May 6, 2013):
Comment created by @ocramius:
That is specifically there to disallow recursive load operations that may occur - did you already try this with latest master?
@doctrinebot commented on GitHub (May 7, 2013):
Comment created by croensch:
I did not exactly use an "Doctrine Proxy". A colleque of me implemented his own proxies, wich instead of loading from an entity manager, load stuff from a webservice. He simply used the template that a normal proxy provided and thats where i found this case, throw exception - return initialized. Wich i found would be valid for real proxies too.
Now i tried to use http://www.doctrine-project.org/blog/doctrine-2-4-beta.html but the composer install just fails because common cant be resolved atm. So i downloaded and compiled all tarballs from github into our project. Now the proxy mechanism seems changed, with an initializer closure(?) instead. Our "Entities" in question won't work with that anymore...
I would have to construct a demo then, implementing real basic proxies with a RDBMS?
@doctrinebot commented on GitHub (May 7, 2013):
Comment created by @ocramius:
[~croensch] did you try setting the minimum-stability flag in composer? Give it a try again with 2.4 and ping back - proxies changed a lot since 2.3
@doctrinebot commented on GitHub (May 8, 2013):
Comment created by croensch:
I reproduced it with the tutorial application, please have a look at the two commits i made on https://github.com/croensch/doctrine2-orm-tutorial/tree/DDC-2432
@doctrinebot commented on GitHub (May 9, 2013):
Comment created by @ocramius:
Proposed a fix at https://github.com/doctrine/doctrine2/pull/663
@doctrinebot commented on GitHub (May 9, 2013):
Issue was closed with resolution "Fixed"