You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The hash type field does not allow atomic updates for its fields. Only the whole field is updated.
Much as in #1286 this causes data loss when a Document is updated in multiple requests/threads at the same time.
Request 1:
// Assume $object is managed by the document manager and the "hash"// Property is mapped as field type "hash" $object->hash['somekey'] = 'foo';
$dm->flush($object);
Request 2:
// Assume $object is the same as in Request 1 (Same _id)// and was loaded before changes in Request 1 were flushed$object->hash['someotherkey'] = 'bar';
$dm->flush();
Depending on which flush occurs last, the resulting hash in mongo db will either be { "somekey": "foo" } or { "someotherkey": "bar" }, but never { "somekey": "foo", "someotherkey": "bar" } (which would be expected, since the hash was extended and not replaced in code).
The text was updated successfully, but these errors were encountered:
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.
The hash type field does not allow atomic updates for its fields. Only the whole field is updated.
Much as in #1286 this causes data loss when a Document is updated in multiple requests/threads at the same time.
Request 1:
Request 2:
Depending on which flush occurs last, the resulting hash in mongo db will either be
{ "somekey": "foo" }
or{ "someotherkey": "bar" }
, but never{ "somekey": "foo", "someotherkey": "bar" }
(which would be expected, since the hash was extended and not replaced in code).The text was updated successfully, but these errors were encountered: