Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-4628

Ensure consistent set of persisted documents

    XMLWordPrintable

Details

    • Epic
    • Status: Backlog
    • Major - P3
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      Epic Summary

      Summary

      Currently Mongoid sometimes persists objects which reference other objects which fail validation, and thus are not persisted. The result is some documents in the database referencing nonexistent documents.

      ActiveRecord uses RDBMS transactions to abort persistence and roll back in some situations. Since MongoDB doesn't have nestable transactions this strategy is not viable for Mongoid. Instead Mongoid must perform a validation pass separately from persistence pass:

      1. Collect all objects which are to be persisted, by walking associations from the object on which save! etc. is called.
      2. Perform validations on all of these objects.
      3. If and only if the validations pass, persist all objects.

      Motivation

      Cast of Characters

      • Product Owner:
      • Project Lead:
      • Program Manager:
      • Drivers Contact:

      Documentation

      [Scope Document|]
      [Technical Design Document|]

      Attachments

        Activity

          People

            Unassigned Unassigned
            oleg.pudeyev@mongodb.com Oleg Pudeyev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: