javax.persistence.PersistenceException

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

Check your annotations to use the proper table and column names.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • {code} ... javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Error calling CallableStatement.getMoreResults at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1692) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1602) at org.hibernate.jpa.internal.StoredProcedureQueryImpl.execute(StoredProcedureQueryImpl.java:224) at support.hibernate.entity.TestHibernate.test(TestHibernate.java:76) ... Caused by: org.hibernate.exception.GenericJDBCException: Error calling CallableStatement.getMoreResults at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109) at org.hibernate.result.internal.OutputsImpl.convert(OutputsImpl.java:79) at org.hibernate.result.internal.OutputsImpl.<init>(OutputsImpl.java:56) at org.hibernate.procedure.internal.ProcedureOutputsImpl.<init>(ProcedureOutputsImpl.java:32) at org.hibernate.procedure.internal.ProcedureCallImpl.buildOutputs(ProcedureCallImpl.java:411) at org.hibernate.procedure.internal.ProcedureCallImpl.getOutputs(ProcedureCallImpl.java:363) at org.hibernate.jpa.internal.StoredProcedureQueryImpl.outputs(StoredProcedureQueryImpl.java:234) at org.hibernate.jpa.internal.StoredProcedureQueryImpl.execute(StoredProcedureQueryImpl.java:217) ... 32 more 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:199) at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4753) at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1378) at org.hibernate.result.internal.OutputsImpl.<init>(OutputsImpl.java:52) ... {code} Have also seen a variant exception (from Oracle code): {{java.sql.SQLException: operation not allowed: Ordinal binding and Named binding cannot be combined!}} Simple stored procedure with a single input and single output parameter: {{create or replace PROCEDURE TEST_PROC(param1 CHAR, retval OUT INTEGER) AS BEGIN retval:=1; END TEST_PROC;}} {code} final StoredProcedureQuery query = entityManager.createStoredProcedureQuery("TEST_PROC"); query.registerStoredProcedureParameter("param1", String.class, ParameterMode.IN); query.registerStoredProcedureParameter("retval", Integer.class, ParameterMode.OUT); query.setParameter("param1", "test"); final Integer retval = (Integer) query.getOutputParameterValue("retval"); // this fails {code} Seems to have been introduced in 5.0.8.
    via by Stephen Fikes,
  • {code} ... javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Error calling CallableStatement.getMoreResults at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1692) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1602) at org.hibernate.jpa.internal.StoredProcedureQueryImpl.execute(StoredProcedureQueryImpl.java:224) at support.hibernate.entity.TestHibernate.test(TestHibernate.java:76) ... Caused by: org.hibernate.exception.GenericJDBCException: Error calling CallableStatement.getMoreResults at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:47) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109) at org.hibernate.result.internal.OutputsImpl.convert(OutputsImpl.java:79) at org.hibernate.result.internal.OutputsImpl.<init>(OutputsImpl.java:56) at org.hibernate.procedure.internal.ProcedureOutputsImpl.<init>(ProcedureOutputsImpl.java:32) at org.hibernate.procedure.internal.ProcedureCallImpl.buildOutputs(ProcedureCallImpl.java:411) at org.hibernate.procedure.internal.ProcedureCallImpl.getOutputs(ProcedureCallImpl.java:363) at org.hibernate.jpa.internal.StoredProcedureQueryImpl.outputs(StoredProcedureQueryImpl.java:234) at org.hibernate.jpa.internal.StoredProcedureQueryImpl.execute(StoredProcedureQueryImpl.java:217) ... 32 more 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:199) at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4753) at oracle.jdbc.driver.OraclePreparedStatementWrapper.execute(OraclePreparedStatementWrapper.java:1378) at org.hibernate.result.internal.OutputsImpl.<init>(OutputsImpl.java:52) ... {code} Have also seen a variant exception (from Oracle code): {{java.sql.SQLException: operation not allowed: Ordinal binding and Named binding cannot be combined!}} Simple stored procedure with a single input and single output parameter: {{create or replace PROCEDURE TEST_PROC(param1 CHAR, retval OUT INTEGER) AS BEGIN retval:=1; END TEST_PROC;}} {code} final StoredProcedureQuery query = entityManager.createStoredProcedureQuery("TEST_PROC"); query.registerStoredProcedureParameter("param1", String.class, ParameterMode.IN); query.registerStoredProcedureParameter("retval", Integer.class, ParameterMode.OUT); query.setParameter("param1", "test"); final Integer retval = (Integer) query.getOutputParameterValue("retval"); // this fails {code} Seems to have been introduced in 5.0.8.
    via by Stephen Fikes,
    • javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: Error calling CallableStatement.getMoreResults at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1692) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1602) at org.hibernate.jpa.internal.StoredProcedureQueryImpl.execute(StoredProcedureQueryImpl.java:224) at support.hibernate.entity.TestHibernate.test(TestHibernate.java:76)

    Users with the same issue

    nasimknasimk
    13 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    TahirTahir
    12 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    tvrmsmithtvrmsmith
    1 times, last one,
    13 more bugmates