{"record":{"id":"065847a355554e36","repo":"mongodb/mongoid","slug":"the-isolation-level-level-is-not-supported","errorCode":null,"errorMessage":"The isolation level '%{level}' is not supported.","messagePattern":"The isolation level '%(.+?)' is not supported\\.","errorType":"exception","errorClass":"Mongoid::Errors::UnsupportedIsolationLevel","httpStatus":null,"severity":"error","filePath":"lib/mongoid/config.rb","lineNumber":197,"sourceCode":"          # it's something we can work with.\n          validate_isolation_level!(level)\n        end\n      else\n        # The default, if Rails does not support IsolatedExecutionState,\n        :thread\n      end\n    end\n\n    # Checks to see if the provided isolation level is something that Mongoid\n    # supports. Raises Errors::UnsupportedIsolationLevel if it is not.\n    #\n    # This will also raise an error if the isolation level is set to `:fiber`\n    # and the Ruby version is less than 3.2, since fiber-local storage\n    # is not supported in earlier Ruby versions.\n    #\n    # @api private\n    def validate_isolation_level!(level)\n      raise Errors::UnsupportedIsolationLevel.new(level) unless VALID_ISOLATION_LEVELS.include?(level)\n\n      return unless level == :fiber && RUBY_VERSION < '3.2'\n\n      raise Errors::UnsupportedIsolationLevel.new(level)\n    end\n\n    # When this flag is false, a document will become read-only only once the\n    # #readonly! method is called, and an error will be raised on attempting\n    # to save or update such documents, instead of just on delete. When this\n    # flag is true, a document is only read-only if it has been projected\n    # using #only or #without, and read-only documents will not be\n    # deletable/destroyable, but they will be savable/updatable.\n    # When this feature flag is turned on, the read-only state will be reset on\n    # reload, but when it is turned off, it won't be.\n    option :legacy_readonly, default: false\n\n    # When this flag is false (the default as of Mongoid 9.0), a document that\n    # is created or loaded will remember the storage options that were active","sourceCodeStart":179,"sourceCodeEnd":215,"githubUrl":"https://github.com/mongodb/mongoid/blob/0da0e23d71adfbad31128c18e5e2c8c301c6f7c4/lib/mongoid/config.rb#L179-L215","documentation":"Error \"The isolation level '%{level}' is not supported.\" thrown in mongodb/mongoid.","triggerScenarios":"Thrown at lib/mongoid/config.rb:197 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0da0e23d71adfbad31128c18e5e2c8c301c6f7c4","analyzedAt":"2026-08-23T06:25:47.656Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}