org.hibernate.exception.GenericJDBCException: Error calling CallableStatement.getMoreResults

Hibernate JIRA | Olegs Sedacs | 5 months ago
  1. 0

    Similar procedure with 2 IN params and 1 OUT works. Exception occurs in procedures with more then 2 IN params; But procedure works if use positional params. Procedure with 3 IN params and 1 OUT {code} @NamedStoredProcedureQuery( name="SaveCodedData", procedureName="FSC_PAYMENTS.CD_PAYM_PROCESING_PKG.save_coded_data", parameters= { @StoredProcedureParameter(name="in_hash", type=String.class, mode= ParameterMode.IN), @StoredProcedureParameter(name="in_data", type=String.class, mode= ParameterMode.IN), @StoredProcedureParameter(name="in_masked", type=String.class, mode= ParameterMode.IN), @StoredProcedureParameter(name="out_result", type=Integer.class, mode= ParameterMode.OUT) } ) {code} Usage : {code} return (int) entityManager .createNamedStoredProcedureQuery("SaveCodedData") .setParameter("in_hash", "value") .setParameter("in_data", "value") .setParameter("in_masked", "value") .getOutputParameterValue("out_result"); {code} Procededure : {code} PROCEDURE save_coded_data ( in_hash VARCHAR2, in_data VARCHAR2, in_masked VARCHAR2, out_result OUT INTEGER ) AS l_sk INTEGER; BEGIN SELECT COUNT INTO l_sk FROM coded_data WHERE hash = in_hash; IF l_sk = 0 THEN INSERT INTO coded_data ( hash, data, masked ) VALUES ( in_hash, in_data, in_masked ); ELSE raise_application_error(-20000, 'Such card already is registered!'); - UPDATE coded_data SET - data = in_data, - masked = in_masked - WHERE hash = in_hash; END IF; out_result := l_sk + 1; END save_coded_data; {code} Exceprion : {code} org.hibernate.exception.GenericJDBCException: Error calling CallableStatement.getMoreResults at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47) ~[hibernate-core-5.1.0.Final.jar:5.1.0.Final] at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111) ~[hibernate-core-5.1.0.Final.jar:5.1.0.Final] at org.hibernate.result.internal.OutputsImpl.convert(OutputsImpl.java:79) ~[hibernate-core-5.1.0.Final.jar:5.1.0.Final] at org.hibernate.result.internal.OutputsImpl.<init>(OutputsImpl.java:56) ~[hibernate-core-5.1.0.Final.jar:5.1.0.Final] at org.hibernate.procedure.internal.ProcedureOutputsImpl.<init>(ProcedureOutputsImpl.java:32) ~[hibernate-core-5.1.0.Final.jar:5.1.0.Final] at org.hibernate.procedure.internal.ProcedureCallImpl.buildOutputs(ProcedureCallImpl.java:420) ~[hibernate-core-5.1.0.Final.jar:5.1.0.Final] at org.hibernate.procedure.internal.ProcedureCallImpl.getOutputs(ProcedureCallImpl.java:372) ~[hibernate-core-5.1.0.Final.jar:5.1.0.Final] at org.hibernate.jpa.internal.StoredProcedureQueryImpl.outputs(StoredProcedureQueryImpl.java:240) ~[hibernate-entitymanager-5.1.0.Final.jar:5.1.0.Final] at org.hibernate.jpa.internal.StoredProcedureQueryImpl.getOutputParameterValue(StoredProcedureQueryImpl.java:279) ~[hibernate-entitymanager-5.1.0.Final.jar:5.1.0.Final] ..... Caused by: java.sql.SQLException: The number of parameter names does not match the number of registered praremeters at oracle.jdbc.driver.OracleSql.setNamedParameters(OracleSql.java:198) ~[ojdbc6-11.2.0.3.0.jar:11.2.0.3.0] at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4712) ~[ojdbc6-11.2.0.3.0.jar:11.2.0.3.0] at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1376) ~[ojdbc6-11.2.0.3.0.jar:11.2.0.3.0] at com.jolbox.bonecp.PreparedStatementHandle.execute(PreparedStatementHandle.java:140) ~[bonecp-0.8.0.RELEASE.jar:na] at org.hibernate.result.internal.OutputsImpl.<init>(OutputsImpl.java:52) ~[hibernate-core-5.1.0.Final.jar:5.1.0.Final] ... 39 common frames omitted {code}

    Hibernate JIRA | 5 months ago | Olegs Sedacs
    org.hibernate.exception.GenericJDBCException: Error calling CallableStatement.getMoreResults
  2. 0

    JPA Paging does not work

    Oracle Community | 5 years ago | 740591
    org.hibernate.exception.GenericJDBCException: The requested operation is not supported on forward only result sets.
  3. 0

    Remote procedure call error

    GitHub | 2 years ago | milci199
    org.hibernate.exception.GenericJDBCException: General error: "java.lang.ArrayIndexOutOfBoundsException: 2048"; SQL statement:|select user0_.id as id4_, user0_.admin as admin4_, user0_.login as login4_, user0_.password as password4_, user0_.userSettings_id as userSett5_4_ from users user0_ where user0_.login=? [50000-180]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    IndexOutOfBound searching in a @Lob field

    Stack Overflow | 4 years ago | caarlos0
    org.hibernate.exception.GenericJDBCException: java.lang.NullPointerException java.lang.NullPointerException
  6. 0

    How to save or retrieve an array column using Hibernate

    Stack Overflow | 3 years ago | user3316847
    org.hibernate.exception.GenericJDBCException: ERRO: transação atual foi interrompida, comandos ignorados até o fim do bloco de transação

    6 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.hibernate.exception.GenericJDBCException

      Error calling CallableStatement.getMoreResults

      at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert()
    2. Hibernate
      SqlExceptionHelper.convert
      1. org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47)[hibernate-core-5.1.0.Final.jar:5.1.0.Final]
      2. org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:111)[hibernate-core-5.1.0.Final.jar:5.1.0.Final]
      2 frames
    3. org.hibernate.result
      OutputsImpl.<init>
      1. org.hibernate.result.internal.OutputsImpl.convert(OutputsImpl.java:79)[hibernate-core-5.1.0.Final.jar:5.1.0.Final]
      2. org.hibernate.result.internal.OutputsImpl.<init>(OutputsImpl.java:56)[hibernate-core-5.1.0.Final.jar:5.1.0.Final]
      2 frames
    4. org.hibernate.procedure
      ProcedureCallImpl.getOutputs
      1. org.hibernate.procedure.internal.ProcedureOutputsImpl.<init>(ProcedureOutputsImpl.java:32)[hibernate-core-5.1.0.Final.jar:5.1.0.Final]
      2. org.hibernate.procedure.internal.ProcedureCallImpl.buildOutputs(ProcedureCallImpl.java:420)[hibernate-core-5.1.0.Final.jar:5.1.0.Final]
      3. org.hibernate.procedure.internal.ProcedureCallImpl.getOutputs(ProcedureCallImpl.java:372)[hibernate-core-5.1.0.Final.jar:5.1.0.Final]
      3 frames
    5. org.hibernate.jpa
      StoredProcedureQueryImpl.getOutputParameterValue
      1. org.hibernate.jpa.internal.StoredProcedureQueryImpl.outputs(StoredProcedureQueryImpl.java:240)[hibernate-entitymanager-5.1.0.Final.jar:5.1.0.Final]
      2. org.hibernate.jpa.internal.StoredProcedureQueryImpl.getOutputParameterValue(StoredProcedureQueryImpl.java:279)[hibernate-entitymanager-5.1.0.Final.jar:5.1.0.Final]
      2 frames