Mongoid transactions returns an error

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: 7.0.5
    • Component/s: Persistence
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • 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 (Inactive)
            Reporter:
            Victor Costa
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: