{"record":{"id":"ab9bda3cab09ab8c","repo":"hibernate/hibernate-orm","slug":"dialect-procedurecall-getsession-getjdbcser","errorCode":null,"errorMessage":"Dialect [\" + procedureCall.getSession().getJdbcServices().getJdbcEnvironment().getDialect().getClass().getName() + \"] not known to support REF_CURSOR parameters","messagePattern":"Dialect \\[\" \\+ procedureCall\\.getSession\\(\\)\\.getJdbcServices\\(\\)\\.getJdbcEnvironment\\(\\)\\.getDialect\\(\\)\\.getClass\\(\\)\\.getName\\(\\) \\+ \"\\] not known to support REF_CURSOR parameters","errorType":"exception","errorClass":"QueryException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/procedure/internal/JTDSCallableStatementSupport.java","lineNumber":63,"sourceCode":"\t\tfinal StringBuilder buffer;\n\t\tfinal int offset;\n\t\tif ( functionReturn != null ) {\n\t\t\tthrow new QueryException( \"The jTDS driver does not support calling functions through the JDBC CallableStatement API\" );\n\t\t}\n\t\toffset = 1;\n\t\tbuffer = new StringBuilder( 9 + procedureName.length() + paramStringSizeEstimate ).append( \"{call \" );\n\n\t\tbuffer.append( procedureName );\n\n\t\tif ( registrations.isEmpty() ) {\n\t\t\tbuffer.append( '(' );\n\t\t}\n\t\telse {\n\t\t\tchar sep = '(';\n\t\t\tfor ( int i = 0; i < registrations.size(); i++ ) {\n\t\t\t\tfinal ProcedureParameterImplementor<?> parameter = registrations.get( i );\n\t\t\t\tif ( parameter.getMode() == ParameterMode.REF_CURSOR ) {\n\t\t\t\t\tthrow new QueryException( \"Dialect [\" + procedureCall.getSession().getJdbcServices().getJdbcEnvironment().getDialect().getClass().getName() + \"] not known to support REF_CURSOR parameters\" );\n\t\t\t\t}\n\t\t\t\tbuffer.append( sep );\n\t\t\t\tfinal JdbcCallParameterRegistration registration = parameter.toJdbcParameterRegistration(\n\t\t\t\t\t\ti + offset,\n\t\t\t\t\t\tprocedureCall\n\t\t\t\t);\n\t\t\t\tif ( parameter.getName() != null ) {\n\t\t\t\t\tbuffer.append( '@' ).append( parameter.getName() ).append( \"=?\" );\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tbuffer.append( \"?\" );\n\t\t\t\t}\n\t\t\t\tsep = ',';\n\t\t\t\tbuilder.addParameterRegistration( registration );\n\t\t\t}\n\t\t}\n\n\t\tbuffer.append( \")}\" );","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/procedure/internal/JTDSCallableStatementSupport.java#L45-L81","documentation":"Error \"Dialect [\" + procedureCall.getSession().getJdbcServices().getJdbcEnvironment().getDialect().getClass().getName() + \"] not known to support REF_CURSOR parameters\" thrown in hibernate/hibernate-orm.","triggerScenarios":"A REF_CURSOR parameter is registered on a dialect/driver without REF_CURSOR support.","commonSituations":"Porting stored procedure code between databases or using a driver (e.g. jTDS, some Sybase setups) lacking cursor support.","solutions":["Use a dialect that supports REF_CURSOR (e.g. OracleDialect, PostgreSQLDialect) instead of the jTDS/Sybase dialect.","Register the parameter as a normal OUT parameter instead of REF_CURSOR."],"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"}