Changes between Version 11 and Version 12 of DjangoSpecifications/Core/SingleInstance


Ignore:
Timestamp:
Mar 24, 2008, 4:16:57 PM (17 years ago)
Author:
Philippe Raoult
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DjangoSpecifications/Core/SingleInstance

    v11 v12  
    2828Here we have a problem if two operations point to the same operand. The first version works well but the second preloads all operands from the DB and the same DB operand will result in multiple operand instances in memory. So we're basically modifying and saving the original operand every time instead of cumulating the changes. Here's a band-aid for your foot.
    2929
    30 Models with self FKs will exhibit exactly the same issues:
     30Models with self FKs will exhibit similar issues:
    3131{{{
    3232
     
    4141        dir.parent.save()
    4242}}}
    43 Now let's see, what if condition returns True for a directory and its parent ? If the parent comes first in the main query, it will be modified, saved, reloaded when its child comes up later. If the child comes up first the parent is loaded, modified, saved, and then later on the original value from the outer query will be modified and saved, thus erasing the first change. FIXME: i'm not sure our proposal would actually fix this case, this needs to be investigated.
     43Now let's see, what if condition returns True for a directory and its parent ? If the parent comes first in the main query, it will be modified, saved, reloaded when its child comes up later. If the child comes up first the parent is loaded, modified, saved, and then later on the original value from the outer query will be modified and saved, thus erasing the first change.
    4444
    4545=== Performance ===
Back to Top