Skip to content

Commit 23edee1

Browse files
committed
Merge pull request #1208
2 parents 0128d99 + 4fb8ffb commit 23edee1

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

docs/en/reference/annotations-reference.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,14 @@ is used for pessimistic and optimistic locking. This is only compatible with
12481248
/** @Int @Version */
12491249
private $version;
12501250
1251+
By default, Doctrine ODM processes updates :ref:`embed-many <embed_many>` and
1252+
:ref:`reference-many <reference_many>` collections in separate write operations,
1253+
which do not bump the document version. Users employing document versioning are
1254+
encouraged to use the :ref:`atomicSet <atomic_set>` or
1255+
:ref:`atomicSetArray <atomic_set_array>` strategies for such collections, which
1256+
will ensure that collections are updated in the same write operation as the
1257+
versioned document.
1258+
12511259
.. _BSON specification: http://bsonspec.org/spec.html
12521260
.. _DBRef: http://docs.mongodb.org/manual/reference/database-references/#dbrefs
12531261
.. _geoNear command: http://docs.mongodb.org/manual/reference/command/geoNear/

docs/en/reference/collection-strategies.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ elements into the array. MongoDB does not allow elements to be added and removed
5252
from an array in a single operation, so this strategy relies on multiple update
5353
queries to remove and insert elements (in that order).
5454

55+
.. _atomic_set:
56+
5557
``atomicSet``
5658
-------------
5759

@@ -66,6 +68,8 @@ strategy can be especially useful when dealing with high concurrency and
6668
The ``atomicSet`` and ``atomicSetArray`` strategies may only be used for
6769
collections mapped directly in a top-level document.
6870

71+
.. _atomic_set_array:
72+
6973
``atomicSetArray``
7074
------------------
7175

0 commit comments

Comments
 (0)