mirror of
https://github.com/doctrine/orm.git
synced 2026-04-25 15:38:10 +02:00
DDC-406: A detached entity can not be removed, on @OneToOne cascade={"remove"} #504
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 (Mar 11, 2010).
Jira issue originally created by user else:
Dear developers,
I have class defined like this:
when i run this:
I get "A detached entity can not be removed".
I don't understand it very well. I need to remove associated entity but it's not done and exception occurs.
I tried it with (like OneToMany)
and
worked without problem like this.
orphanRemoval set it's not working so.
Thank for solve and perfect ORM!!! ;-)
Andy
@doctrinebot commented on GitHub (Mar 12, 2010):
Comment created by else:
Dear Roman,
When are you going to release 2.0-BETA1 [ 10030 ]? I ask you because i need this patch now to continue my developing.
Thank you very much.
Andy
@doctrinebot commented on GitHub (Mar 15, 2010):
Comment created by romanb:
Hi,
I created a test case (attached to this issue) that works well. Can you please modify that test so that it reflects your issue or tell me how to modify it so I can reproduce your problem? Thanks.
If you have the Doctrine tests checked out you can just copy this file into the tests/Doctrine/Tests/ORM/Functional/Ticket folder and run it with: "phpunit Doctrine/Tests/ORM/Functional/Ticket/DDC406Test".
@doctrinebot commented on GitHub (Mar 15, 2010):
Comment created by else:
Dear Roman,
Check this issue at first: http://www.doctrine-project.org/jira/browse/DDC-422 Maybe my extending cause also this issue. If you can't reproduce it with my extending write me and i'll try your test.
Thank you.
Andy
@doctrinebot commented on GitHub (Mar 16, 2010):
Comment created by else:
Dear Roman,
I can't understand how you could run that test.
First there wasn't set generatedValue strategy so i added it. It throw very stupid exception. Maybe it will be better to correct this error to understand what's wrong easier.
Then there wasn't set Column type so added either.
Then when i run test with "phpunit Doctrine/Tests/ORM/Functional/Ticket/DDC406Test.php" i got same error i reported.
I'm attaching edited test.
Andy
@doctrinebot commented on GitHub (Mar 16, 2010):
Comment created by romanb:
@GeneratedValue is the same as @GeneratedValue(strategy="AUTO"), AUTO is the default strategy, at least in trunk, and to run the test, you should check out trunk.
@Column is the same as @Column(type="string"), string is the default type.
@doctrinebot commented on GitHub (Mar 16, 2010):
Comment created by romanb:
It makes no sense to test against ALPHA4, please use trunk.
@doctrinebot commented on GitHub (Mar 16, 2010):
Comment created by romanb:
Your new test still works fine for me, again using trunk. So your problem might be already fixed.
@doctrinebot commented on GitHub (Mar 16, 2010):
Comment created by else:
Dear Roman,
I checkouted trunk version and it solves this problem. I'm sorry that i consumed your time with that. I'm not used to solve problems like this. Hope i can help better now to make doctrine more stable.
Andy
@doctrinebot commented on GitHub (Mar 16, 2010):
Comment created by romanb:
OK, at least now you know already how to deal with test cases :)
@doctrinebot commented on GitHub (Mar 16, 2010):
Issue was closed with resolution "Fixed"
@doctrinebot commented on GitHub (Dec 13, 2015):
Imported 2 attachments from Jira into https://gist.github.com/55a4c0106618cc5460da