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

Mongoid transactions returns an error

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 7.0.5
    • Component/s: Persistence
    • Labels:
      None

      I tried to play with Mongoid transactions, but an error message popped up...

      Code snippet:

      Project.with_session do |session|
        session.start_transaction
        Project.create!(name: 'Example')
        session.commit_transaction
      end
      

      Error:

      Mongo::Error::OperationFailure: Transaction numbers are only allowed on a replica set member or mongos (20) (on :27017, legacy retry, attempt 1) (on :27017, legacy retry, attempt 1)

      **

            Assignee:
            emily.giurleo@mongodb.com Emily Giurleo (Inactive)
            Reporter:
            victorcorcos@gmail.com Victor Costa
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: