DDC-4105: [GH-1577] [RFC] [BC Break] [3.x] Prototype - merge/detach removal #4916

Closed
opened 2026-01-22 14:51:58 +01:00 by admin · 1 comment
Owner

Originally created by @doctrinebot on GitHub (Dec 3, 2015).

Jira issue originally created by user @doctrinebot:

This issue is created automatically through a Github pull request on behalf of Ocramius:

Url: https://github.com/doctrine/doctrine2/pull/1577

Message:

This PR simply attempts to get rid of EntityManager#merge() and EntityManager#detach() operations.

While merge and detach can be useful in contexts where entities are being serialized:

  • serializing entities is something we suggest NOT doing
  • the semantics really don't fit PHP
  • the merge operations are quite aggressive and cause a lot of issues
  • cascade merges not configured correctly = hell
  • EntityManager#clear() is a much better API for long-running and multi-threaded processes
  • the initial use-case around EntityManager#merge() was to merge data without further queries (when avoidable): the Second Level Cache now solves that problem in a more elegant way.
Originally created by @doctrinebot on GitHub (Dec 3, 2015). Jira issue originally created by user @doctrinebot: This issue is created automatically through a Github pull request on behalf of Ocramius: Url: https://github.com/doctrine/doctrine2/pull/1577 Message: This PR simply attempts to get rid of `EntityManager#merge()` and `EntityManager#detach()` operations. While `merge` and `detach` can be useful in contexts where entities are being serialized: - serializing entities is something we suggest NOT doing - the semantics really don't fit PHP - the merge operations are quite aggressive and cause a lot of issues - cascade merges not configured correctly = hell - `EntityManager#clear()` is a much better API for long-running and multi-threaded processes - the initial use-case around `EntityManager#merge()` was to merge data without further queries (when avoidable): the Second Level Cache now solves that problem in a more elegant way.
admin added the ImprovementBC Break labels 2026-01-22 14:51:58 +01:00
admin closed this issue 2026-01-22 14:51:59 +01:00
Author
Owner

@Majkl578 commented on GitHub (Sep 11, 2017):

#1577 has been merged into develop.

@Majkl578 commented on GitHub (Sep 11, 2017): #1577 has been merged into develop.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4916