DDC-1033: Cloned proxies show unexpected behavior when initialized #1288

Closed
opened 2026-01-22 13:08:31 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Feb 14, 2011).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user k-fish:

When a proxy has been loaded and is cloned before being initialized, it will behave unexpectedly.

_load() in the proxy starts a chain of method calls that end up loading the data and putting it into the proxy being in the identity map inside UoW. Now the registered proxy will be updated, but the cloned copy will of course not be changed - except it will behave as if it was initialized. This leads (at least in my case) to changes not being picked up after merge() has been called.

In my case I could work around this if I could ask the proxy to initialize itself (DDC-733). More transparent would be a **clone() method in the proxy that initializes the proxy. This might also be related to DDC-18.

Originally created by @doctrinebot on GitHub (Feb 14, 2011). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user k-fish: When a proxy has been loaded and is cloned before being initialized, it will behave unexpectedly. `_load()` in the proxy starts a chain of method calls that end up loading the data and putting it into the proxy being in the identity map inside UoW. Now the registered proxy will be updated, but the cloned copy will of course not be changed - except it will behave as if it was initialized. This leads (at least in my case) to changes not being picked up after `merge()` has been called. In my case I could work around this if I could ask the proxy to initialize itself ([DDC-733](http://www.doctrine-project.org/jira/browse/DDC-733)). More transparent would be a `**clone()` method in the proxy that initializes the proxy. This might also be related to [DDC-18](http://www.doctrine-project.org/jira/browse/DDC-18).
admin added the Bug label 2026-01-22 13:08:31 +01:00
admin closed this issue 2026-01-22 13:08:31 +01:00
Author
Owner

@doctrinebot commented on GitHub (Feb 18, 2011):

Comment created by @beberlei:

This issue is rather tricky, since **clone is called AFTER the actual clone, on the CLONED object. What we need is before the clone on the original object. This is pretty problematic to solve, i have to wrap my head around it.

@doctrinebot commented on GitHub (Feb 18, 2011): Comment created by @beberlei: This issue is rather tricky, since **clone is called AFTER the actual clone, on the CLONED object. What we need is before the clone on the original object. This is pretty problematic to solve, i have to wrap my head around it.
Author
Owner

@doctrinebot commented on GitHub (Feb 26, 2011):

Comment created by @beberlei:

Fixed.

@doctrinebot commented on GitHub (Feb 26, 2011): Comment created by @beberlei: Fixed.
Author
Owner

@doctrinebot commented on GitHub (Feb 26, 2011):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Feb 26, 2011): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1288