{"record":{"id":"fe170df9d37ccdea","repo":"hibernate/hibernate-orm","slug":"unrecognized-flush-mode","errorCode":null,"errorMessage":"Unrecognized flush mode : {}","messagePattern":"Unrecognized flush mode : (.+?)","errorType":"exception","errorClass":"HibernateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/boot/jaxb/hbm/internal/FlushModeConverter.java","lineNumber":43,"sourceCode":"\t\t// Also, we want to map \"never\"->MANUAL (rather than NEVER)\n\t\tif ( name == null ) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif ( \"never\".equalsIgnoreCase( name ) ) {\n\t\t\treturn FlushMode.MANUAL;\n\t\t}\n\t\telse if ( \"auto\".equalsIgnoreCase( name ) ) {\n\t\t\treturn FlushMode.AUTO;\n\t\t}\n\t\telse if ( \"always\".equalsIgnoreCase( name ) ) {\n\t\t\treturn FlushMode.ALWAYS;\n\t\t}\n\n\t\t// if the incoming value was not null *and* was not one of the pre-defined\n\t\t// values, we need to throw an exception.  This *should never happen if the\n\t\t// document we are processing conforms to the schema...\n\t\tthrow new HibernateException( \"Unrecognized flush mode : \" + name );\n\t}\n\n\tpublic static String toXml(FlushMode mode) {\n\t\tif ( mode == null ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// conversely, we want to map MANUAL -> \"never\" here\n\t\tif ( mode == FlushMode.MANUAL ) {\n\t\t\treturn \"never\";\n\t\t}\n\n\t\t// todo : what to do if the incoming value does not conform to allowed values?\n\t\t// for now, we simply don't deal with that (we write it out).\n\n\t\treturn mode.name().toLowerCase( Locale.ENGLISH );\n\t}\n}","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/boot/jaxb/hbm/internal/FlushModeConverter.java#L25-L61","documentation":"Error \"Unrecognized flush mode : {}\" thrown in hibernate/hibernate-orm.","triggerScenarios":"An unrecognized flush mode value appears in a mapping document.","commonSituations":"A typo or unsupported value in the flush-mode attribute of a legacy hbm.xml mapping.","solutions":["Use a valid flush mode value in the hbm.xml: ALWAYS, AUTO, COMMIT, or MANUAL.","Fix typos or case errors in the flush-mode attribute.","Remove the attribute to inherit the default flush mode."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}