{"record":{"id":"412c9b47f4e7fdee","repo":"hibernate/hibernate-orm","slug":"could-not-convert-isolation-value-to-java-sql","errorCode":null,"errorMessage":"Could not convert isolation value [{}] to java.sql.Connection constant name","messagePattern":"Could not convert isolation value \\[(.+?)\\] to java\\.sql\\.Connection constant name","errorType":"exception","errorClass":"HibernateException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/ConnectionProviderInitiator.java","lineNumber":381,"sourceCode":"\t\t\tthrow new ConnectionProviderConfigurationException( \"Unknown transaction isolation level: \" + isolationLevel );\n\t\t}\n\t}\n\n\t/**\n\t * Gets the {@link Connection} constant name corresponding to the given isolation.\n\t *\n\t * @param isolation The transaction isolation numeric value.\n\t *\n\t * @return The corresponding Connection constant name.\n\t *\n\t * @throws HibernateException If the given isolation does not map to JDBC standard isolation\n\t *\n\t * @see #toIsolationNiceName\n\t */\n\tpublic static String toIsolationConnectionConstantName(Integer isolation) {\n\t\tfinal String name = ISOLATION_VALUE_CONSTANT_NAME_MAP.get( isolation );\n\t\tif ( name == null ) {\n\t\t\tthrow new HibernateException(\n\t\t\t\t\t\"Could not convert isolation value [\" + isolation + \"] to java.sql.Connection constant name\"\n\t\t\t);\n\t\t}\n\t\treturn name;\n\t}\n\n\t/**\n\t * Get the name of a JDBC transaction isolation level\n\t *\n\t * @param isolation The transaction isolation numeric value.\n\t *\n\t * @return a nice human-readable name\n\t *\n\t * @see #toIsolationConnectionConstantName\n\t */\n\tpublic static String toIsolationNiceName(Integer isolation) {\n\t\tfinal String name = isolation != null ? ISOLATION_VALUE_NICE_NAME_MAP.get( isolation ) : null;\n\t\treturn name == null ? \"<unknown>\" : name;","sourceCodeStart":363,"sourceCodeEnd":399,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/ConnectionProviderInitiator.java#L363-L399","documentation":"Error \"Could not convert isolation value [{}] to java.sql.Connection constant name\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown at hibernate-core/src/main/java/org/hibernate/engine/jdbc/connections/internal/ConnectionProviderInitiator.java:381 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide an isolation value that maps to a java.sql.Connection constant (1, 2, 4, or 8)","Use the constant name instead of an arbitrary string for the isolation setting"],"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"}