#1589: M2M-unlink() is not transaction-safe
---------------------------------------+------------------------------------
Reporter: floriank | Owner: romanb
Type: defect | Status: new
Priority: major | Milestone: 1.0.4
Component: Record | Version: 1.0.3
Keywords: record transaction unlink | Has_test: 1
Mystatus: Pending Core Response | Has_patch: 1
---------------------------------------+------------------------------------
When using unlink() on a m2m-relation without calling ->save() the
relation is unlinked anyhow (see attached testcase).
I think this is because of an explicit delete-query in Record::unlink().
If i remove this query (see attached patch) and let
UnitOfWork::saveAssociations() do the job by making its ->getDeleteDiff()
everything in my testcase is working as intended. I suppose Record::link()
to be having this problem, too.
I didn't test neither any other cases nor patch the Record::link()-method
but only want the patch for a base for discussion: Could you please have a
look at it and share your thoughts?
--
Ticket URL: <http://trac.doctrine-project.org/ticket/1589>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"doctrine-svn" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---