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

Remove on a specific Entity and a subsequent find will retrieve the same entity with a Managed state #6123

Closed
bertuz opened this issue Nov 9, 2016 · 6 comments · Fixed by #11428

Comments

@bertuz
Copy link

bertuz commented Nov 9, 2016

I don't know if it's the expected behavior, beh when removing a specific Entity, it is removed from the Identity Map. This implies that the subsequent finds within a single UoW will fetch the Entity with a 'MANAGED' state. Is this the expected behavior?


/**
     * INTERNAL:
     * Schedules an entity for deletion.
     *
     * @param object $entity
     *
     * @return void
     */
    public function scheduleForDelete($entity)
    {
        $oid = spl_object_hash($entity);

        if (isset($this->entityInsertions[$oid])) {
            if ($this->isInIdentityMap($entity)) {
                $this->removeFromIdentityMap($entity);
            }
@Ocramius
Copy link
Member

Ocramius commented Nov 9, 2016

@bertuz looks like a bug. Can you try reproducing it against https://github.com/doctrine/doctrine2/tree/d3f6c5ec70aac4b029a4b61ecf1e2ba61a1a4a6d/tests/Doctrine/Tests/ORM/Functional/Ticket please? (see that dir for examples)

@bertuz
Copy link
Author

bertuz commented Nov 9, 2016

of course, by tomorrow

@bertuz
Copy link
Author

bertuz commented Nov 10, 2016

@Ocramius I was about to add a test into Tests/ORM/Functional/Ticket but I don't know where to get the ticket number in order to name the file + open a pull req. Can you please show me the right way to that?

@Ocramius
Copy link
Member

You can call it like this issue (6123)

On 10 Nov 2016 09:56, "Matteo" [email protected] wrote:

@Ocramius https://github.com/Ocramius I was about to add a test into
Tests/ORM/Funcitonal/Ticket but I don't know where to get the ticket
number in order to name the file + open a pull req. Can you please show me
the right way to that?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#6123 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAJakACTExpnVHtp4VNeLA_33m7RC_BTks5q8twigaJpZM4KtT0s
.

@bertuz
Copy link
Author

bertuz commented Nov 10, 2016

here you go #6126

@xificurk
Copy link
Contributor

Fixed by #11428

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants