Task #4931

Check correct behaviour of object replacement in persistence

Added by Karsten Dambekalns almost 6 years ago. Updated over 4 years ago.

Status:Closed Start date:2010-03-08
Priority:Must have Due date:
Assigned To:Karsten Dambekalns % Done:

50%

Category:Persistence
Target version:- Estimated time:8.00 hours
Sprint: Has patch:
PHP Version: Complexity:

Description

When an object that is a persisted entity is cloned, we (through AOP) set a cloned flag and drop the memorized clean state of the object. Why is that flag still true after calling Repository->update() was the original question. It turns out we need to check the correct behaviour of the persistence in (at least) the following cases:

  • cloned object is given to update(), then to add()
  • cloned object is given to add(), then update()
  • cloned object is given to replace(), what about doing this multiple times?
  • the cloned object is given to update() and/or replace(), now the original is in turn added again

Part of the problem is to find out which of those scenarious should be allowed and what the correct behavior would be...

The involved data that is involved with this is (at least):

  • FLOW3_Persistence_Entity_UUID
  • FLOW3_Persistence_cleanProperties
  • FLOW3_Persistence_clone

Along the way we probably need to make sure the memorized clean properties are not thrown away when cloning, because after an update() (or replace()) call we need those properties for correct persistence (and because of my planned solution for #4317).

Also make sure entities given to replace() get the new UUID also in their internals!

Associated revisions

Revision 854bf31e
Added by Karsten Dambekalns almost 6 years ago

[~TASK] FLOW3 (MVC): Fixed an error with handling an error in transformValue().
[~TASK] FLOW3 (Persistence): changed the way cloning affect the memorized clean state of an entity, relates to #4931.
[~TASK] Testing: unit tests are now looked for in Tests/Unit/ instead of Tests/.

[!!!][~TASK] FLOW3 (Resource): Changed the way resources from packages are addressed: files in packages are now fetched by getResource('package:<packageKey>/<relativePathInResources>').

[!!!][~TASK] DocumentationBrowser: Moved all unit tests to new subdirectory, added directory for system tests.
[!!!][~TASK] FLOW3: Moved all unit tests to new subdirectory, added directory for system tests.
[!!!][~TASK] Fluid: Moved all unit tests to new subdirectory, added directory for system tests.
[!!!][~TASK] Kickstart: Moved all unit tests to new subdirectory, added directory for system tests.
[!!!][~TASK] Party: Moved all unit tests to new subdirectory, added directory for system tests.
[!!!][~TASK] PHP6: Moved all unit tests to new subdirectory, added directory for system tests.
[!!!][~TASK] Welcome: Moved all unit tests to new subdirectory, added directory for system tests.
[!!!][~TASK] YAML: Moved all unit tests to new subdirectory, added directory for system tests.

Revision 616762ca
Added by Karsten Dambekalns over 5 years ago

[+BUGFIX] FLOW3 (Persistence): Fixed a bug with persistence that hit when updated objects were to be persisted but seen through a property of another object first (order of persistObject calls). Fixes #6581, relates to #4931.

History

#1 Updated by Karsten Dambekalns over 5 years ago

  • Target version set to 1.0 alpha 8

#2 Updated by Karsten Dambekalns over 5 years ago

  • Status changed from New to Accepted
  • Assigned To set to Karsten Dambekalns

#3 Updated by Robert Lemke over 5 years ago

  • % Done changed from 0 to 50
  • Estimated time set to 8.00

#4 Updated by Robert Lemke over 5 years ago

  • Start date changed from 2009-10-07 to 2010-03-08

#5 Updated by Karsten Dambekalns over 5 years ago

  • Target version changed from 1.0 alpha 8 to 1.0 alpha 9

#6 Updated by Robert Lemke about 5 years ago

  • Target version deleted (1.0 alpha 9)

#7 Updated by Karsten Dambekalns over 4 years ago

  • Status changed from Accepted to Closed
  • Remaining (hours) set to 8.0

Also available in: Atom PDF