-
-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Locking is broken when ClassMetadata is cached #2278
Comments
buffcode
added a commit
to buffcode/mongodb-odm
that referenced
this issue
Feb 3, 2021
Caching / unserializing ClassMetadata broke locking functionality Fixes doctrine#2278
buffcode
added a commit
to buffcode/mongodb-odm
that referenced
this issue
Feb 3, 2021
Caching / unserializing ClassMetadata broke locking functionality Fixes doctrine#2278
buffcode
added a commit
to buffcode/mongodb-odm
that referenced
this issue
Feb 3, 2021
Caching / unserializing ClassMetadata broke locking functionality Fixes doctrine#2278
Forgot to link issues before, closing as #2281 was merged |
alcaeus
added a commit
that referenced
this issue
May 21, 2021
* Fix locking when ClassMetadata is unserialized Caching / unserializing ClassMetadata broke locking functionality Fixes #2278 * Test serialization of lock/version fields * Update working-with-objects.rst Detach doc text from code block * Update storage-strategies.rst * Fix invalid strict comparison when validating mappings * Correctly handle write concern specified in defaultCommitOptions (#2294) * Fix documentation for uploadFromFile * Fix mapping of the nullable option for XML driver * Fix query preparation when in elemMatch (#2299) * Fix preparation of $elemMatch operators in queries (#2298) * Fix using null values in partial filter expressions (#2300) * Fix errors with nullable typed associations (#2302) * Fix initialising nullable associations * Fix error when merging documents with uninitialised typed properties Co-authored-by: buffcode <buffcode@users.noreply.github.com> Co-authored-by: Laurens Stötzel <l.stoetzel@meeva.de> Co-authored-by: Maciej Malarz <malarzm@gmail.com> Co-authored-by: jeeiex <78592605+jeeiex@users.noreply.github.com> Co-authored-by: Claudio Zizza <859964+SenseException@users.noreply.github.com> Co-authored-by: Andreas Braun <git@alcaeus.org> Co-authored-by: Gocha Ossinkine <ossinkine@ya.ru> Co-authored-by: Ryan RAJKOMAR <rrajkomar@users.noreply.github.com> Co-authored-by: wuchen90 <wu.chen@agriconomie.com> Co-authored-by: Andreas Braun <alcaeus@users.noreply.github.com>
alcaeus
added a commit
that referenced
this issue
Aug 5, 2021
* Fix locking when ClassMetadata is unserialized Caching / unserializing ClassMetadata broke locking functionality Fixes #2278 * Test serialization of lock/version fields * Update working-with-objects.rst Detach doc text from code block * Update storage-strategies.rst * Fix invalid strict comparison when validating mappings * Correctly handle write concern specified in defaultCommitOptions (#2294) * Fix documentation for uploadFromFile * Fix mapping of the nullable option for XML driver * Fix query preparation when in elemMatch (#2299) * Fix preparation of $elemMatch operators in queries (#2298) * Fix using null values in partial filter expressions (#2300) * Fix errors with nullable typed associations (#2302) * Fix initialising nullable associations * Fix error when merging documents with uninitialised typed properties * Allow mixed value in $not operator (#2307) * [2.2] Fix builds (#2319) * Fix wrong handling for nullable fields in upsert and update (#2318) * Comprehensively test nullable behaviour for embedOne Co-authored-by: wuchen90 <wu.chen@agriconomie.com> * Fix handling of nullable fields for upsert Co-authored-by: wuchen90 <wu.chen@agriconomie.com> * Fix handling of upserts during scheduling for deletion (#2334) * Fix handling of upserts during scheduling for deletion * Added test * Fix wrong assertion (#2335) This was uncovered by Psalm testing when merging 2.2.x up into 2.3.x. * Remove psalm-baseline.xml Co-authored-by: buffcode <buffcode@users.noreply.github.com> Co-authored-by: Laurens Stötzel <l.stoetzel@meeva.de> Co-authored-by: Maciej Malarz <malarzm@gmail.com> Co-authored-by: jeeiex <78592605+jeeiex@users.noreply.github.com> Co-authored-by: Claudio Zizza <859964+SenseException@users.noreply.github.com> Co-authored-by: Gocha Ossinkine <ossinkine@ya.ru> Co-authored-by: Ryan RAJKOMAR <rrajkomar@users.noreply.github.com> Co-authored-by: wuchen90 <wu.chen@agriconomie.com> Co-authored-by: Fran Moreno <franmomu@gmail.com> Co-authored-by: Bernhard Schussek <bschussek@gmail.com>
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Bug Report
Summary
Lock functionality is broken as soon as a non-volatile ClassMetadata cache is used.
Current behavior
When a
metadata_cache_driver
is defined, Doctrine MongoDB caches theClassMetadata
using the given driver by serializing all relevant fields. The fieldsisLockable
andlockField
are not serialized.On a second request (or after the cache has been warmed),
ClassMetadata
has no information about locking-behaviour anymore and calls to->lock(...)
will fail withundefined index
, as$this->class->lockField
is empty [1] and there is no field mapping for this empty value.How to reproduce
cache:warmup
or trigger application)Expected behavior
Lock functionality should work, even when
ClassMetadata
is cached.Solution
Include
isLockable
andlockField
in serialization (PRs incoming).The text was updated successfully, but these errors were encountered: