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

Reloadable#reload_embedded_document doesn't respect session

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.4.0
    • Affects Version/s: None
    • Component/s: None
    • None

      def reload_embedded_document
      extract_embedded_attributes({}.merge(
      collection(_root).find(_root.atomic_selector).read(mode: :primary).first
      ))
      end

      This find call should be

      collection.find(atomic_selector, session: _session)

       

      as in the method call above it, causes the find to return nil during a transaction (where the record was created inside it, but it has yet to be committed) and then we merge in nil and raise error

            Assignee:
            neil.shweky@mongodb.com Neil Shweky (Inactive)
            Reporter:
            michael@brightbits.co.uk Michael Baldry
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: