1
0
mirror of synced 2025-01-10 19:17:10 +03:00
Commit Graph

11 Commits

Author SHA1 Message Date
Marco Pivetta
438feccd55 #1172 - removing redundant test logic 2015-01-16 22:25:41 +01:00
Marco Pivetta
de4e980389 #1172 - covering merging of unmanaged, un-initialized proxies bound to a different entity manager 2015-01-16 22:25:00 +01:00
Marco Pivetta
b7566dc65b #1172 - correcting test: all connections should have a saved file instance 2015-01-16 22:20:58 +01:00
Marco Pivetta
d1e7960f99 #1172 - tests to verify that proxies keep distinct entity manager instances even across merging operations 2015-01-16 22:12:42 +01:00
Marco Pivetta
4ed0a6ce53 #1172 - removing redundant tests 2015-01-16 21:25:25 +01:00
Marco Pivetta
3df119f4fe #1172 - when merging an initialized proxy, the managed proxy must be initialized before merging 2015-01-16 21:23:47 +01:00
Marco Pivetta
a18f258b4d #1172 - covering merging of managed proxies 2015-01-16 21:15:39 +01:00
Marco Pivetta
0329ac5074 #1172 - covering also detached proxies - merging operations should not initialize either proxy 2015-01-16 21:14:13 +01:00
Marco Pivetta
dde09872df #1172 - writing a more concise test case about merging detached proxies 2015-01-16 21:09:53 +01:00
Mathieu De Zutter
318b23097b Don't load uninitialized proxies after merging.
Previous patch avoided initialization of proxies before merging, mainly to
fix a bug with merging. However, later on, doctrine tries again to load
the proxy. This is unnecessary and thus has been removed. This way, a
round trip to the database is saved.
2015-01-16 20:54:15 +01:00
Mathieu De Zutter
ec35d4886c Don't load detached proxies when merging them.
Ticket DDC-1392 fixed an issue where uninitialized proxies could not be merged
because the merge routine couldn't get the identifier from them. The soution
was to initialize the proxy.
Ticket DDC-1734 fixed the merging of *unserialized* uninitialized proxies by
resetting their internals, so these proxies were able to initialize, as required
by the fix for DDC-1392.

Somehow, in the meanwhile, the fix for DDC-1392 is not needed anymore:
reverting the patch will not break the associated test (but it does break the
test for DDC-1734). This means it is not needed anymore to initialize the proxy
when merging.

Uninitialized proxies that get merged should not be loaded at all.  Since they
are not initialized, the entity data for sure hasn't changed, so it can be
safely ignored. Actually, the only thing the data is needed for while merging,
is to copy it into the managed entity, but that one is already supposed to be
up to date. By not initializing the proxy, a potential database roundtrip is
saved, and the fix for DDC-1734 is not needed anymore.

Besides optimizing the merge, this patch also solves an issue with merging.
Currently, when a detached uninitialized proxy is merged while there is already a
corresponding managed entity (proxy or not), the ORM returns a blank entity
instead of returning the already managed entity. This patch makes sure that
already existing managed entities are re-used.
2015-01-16 20:54:15 +01:00