i am trying to migrate to Spring 3 and hibernate 6 and i am using StoredProcedureQuery with named parameters, it was working fine in Hibernate 5, but when i migrated to Hibernate 6 it fails with this error Error calling CallableStatement.getMoreResults [ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to ‘GET_NEXT_MESSAGES’
it’s failing in Oracle and Mssql Db, when i change the order of the registerStoredProcedureParameter methods to match the procedure order, it works fine, is the param name is not being considered any more???
is there any way to make it work same as the old behavior without changing the order of the registered params as i am passing the param name??
I don’t know how this worked before, but as far as I understand, Oracle does not support named parameters for callable statements through JDBC. Maybe that’s old information and this was fixed in the meantime, but nobody actually complained so far.
If you have a source for the named parameter support, please share that with us and then we can take a look at supporting this.
The same holds for SQL Server. To our knowledge, the driver simply does not support named parameters.
sorry for bringing up this old conversation but it fits a change we recently noticed in our project. We upgraded to Jakarta 10, JDK17 and also Hibernate 6.6. After doing that we were confused because certain Stored Procedures in our Oracle 19c database worked just like before and others caused an exception like described in this topic. After we switched the order of the parameters in our calls to the order used within the database these procedures worked again as before our migration.
The only question is: What changed that causes this new behaviour? Anyone who noticed that as well?
I don’t know what it is exactly that causes problems for you, but we fixed binding parameters by name via JDBC in ORM 6.6 through: Jira
Maybe there is a bug. Please try to create a reproducer with our test case template and if you are able to reproduce the issue, create a bug ticket in our issue tracker and attach that reproducer.
We are using 6.6.3 and still could see the issue with named parameters. We have to call StoredProcedureQuery.setParameter in same sequence as that of store procedure to make it work.