org.hibernate.exception.GenericJDBCException: could not execute query

Hibernate JIRA | Martin Šimka | 4 years ago
  1. 0

    This [test|https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/test/java/org/hibernate/test/sql/hand/custom/oracle/OracleCustomSQLTest.java] fails while fetching data from stored function Stacktrace: {quote} org.hibernate.exception.GenericJDBCException: could not execute query at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) at org.hibernate.loader.Loader.doList(Loader.java:2519) at org.hibernate.loader.Loader.doList(Loader.java:2502) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2332) at org.hibernate.loader.Loader.list(Loader.java:2327) at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:338) at org.hibernate.internal.SessionImpl.listCustomQuery(SessionImpl.java:1788) at org.hibernate.internal.AbstractSessionImpl.list(AbstractSessionImpl.java:231) at org.hibernate.internal.SQLQueryImpl.list(SQLQueryImpl.java:157) at org.hibernate.test.sql.hand.custom.CustomStoredProcTestSupport.testEntityStoredProcedure(CustomStoredProcTestSupport.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:63) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30) at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:62) Caused by: java.sql.SQLException: Cannot perform fetch on a PLSQL statement: next at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70) at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:271) at oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:209) at org.hibernate.loader.Loader.processResultSet(Loader.java:938) at org.hibernate.loader.Loader.doQuery(Loader.java:910) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:341) at org.hibernate.loader.Loader.doList(Loader.java:2516) ... 20 more {quote} Output: {noformat} ... 07:23:38,214 DEBUG SQL:104 - INSERT INTO EMPLOYMENT (EMPLOYEE, EMPLOYER, STARTDATE, REGIONCODE, VALUE, CURRENCY, EMPID) VALUES (?, ?, CURRENT_DATE, UPPER(?), ?, ?, ?) 07:23:38,257 DEBUG SQL:104 - { ? = call allEmployments() } 07:23:38,268 WARN SqlExceptionHelper:143 - SQL Error: 17166, SQLState: 99999 07:23:38,268 ERROR SqlExceptionHelper:144 - Cannot perform fetch on a PLSQL statement: next 07:23:38,272 INFO SchemaExport:343 - HHH000227: Running hbm2ddl schema export 07:23:38,273 DEBUG SchemaExport:353 - Import file not found: /import.sql ... {noformat}

    Hibernate JIRA | 4 years ago | Martin Šimka
    org.hibernate.exception.GenericJDBCException: could not execute query
  2. 0

    This [test|https://github.com/hibernate/hibernate-orm/blob/master/hibernate-core/src/test/java/org/hibernate/test/sql/hand/custom/oracle/OracleCustomSQLTest.java] fails while fetching data from stored function Stacktrace: {quote} org.hibernate.exception.GenericJDBCException: could not execute query at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:54) at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:125) at org.hibernate.loader.Loader.doList(Loader.java:2519) at org.hibernate.loader.Loader.doList(Loader.java:2502) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2332) at org.hibernate.loader.Loader.list(Loader.java:2327) at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:338) at org.hibernate.internal.SessionImpl.listCustomQuery(SessionImpl.java:1788) at org.hibernate.internal.AbstractSessionImpl.list(AbstractSessionImpl.java:231) at org.hibernate.internal.SQLQueryImpl.list(SQLQueryImpl.java:157) at org.hibernate.test.sql.hand.custom.CustomStoredProcTestSupport.testEntityStoredProcedure(CustomStoredProcTestSupport.java:100) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42) at org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:63) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30) at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:62) Caused by: java.sql.SQLException: Cannot perform fetch on a PLSQL statement: next at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70) at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:271) at oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:209) at org.hibernate.loader.Loader.processResultSet(Loader.java:938) at org.hibernate.loader.Loader.doQuery(Loader.java:910) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:341) at org.hibernate.loader.Loader.doList(Loader.java:2516) ... 20 more {quote} Output: {noformat} ... 07:23:38,214 DEBUG SQL:104 - INSERT INTO EMPLOYMENT (EMPLOYEE, EMPLOYER, STARTDATE, REGIONCODE, VALUE, CURRENCY, EMPID) VALUES (?, ?, CURRENT_DATE, UPPER(?), ?, ?, ?) 07:23:38,257 DEBUG SQL:104 - { ? = call allEmployments() } 07:23:38,268 WARN SqlExceptionHelper:143 - SQL Error: 17166, SQLState: 99999 07:23:38,268 ERROR SqlExceptionHelper:144 - Cannot perform fetch on a PLSQL statement: next 07:23:38,272 INFO SchemaExport:343 - HHH000227: Running hbm2ddl schema export 07:23:38,273 DEBUG SchemaExport:353 - Import file not found: /import.sql ... {noformat}

    Hibernate JIRA | 4 years ago | Martin Šimka
    org.hibernate.exception.GenericJDBCException: could not execute query
  3. 0

    Cannot perform fetch on a PLSQL statement: next

    Stack Overflow | 3 years ago
    java.sql.SQLException: Cannot perform fetch on a PLSQL statement: next
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    java.sql.SQLException: Cannot perform fetch on a PLSQL statement: next

    Stack Overflow | 2 years ago
    java.sql.SQLException: Cannot perform fetch on a PLSQL statement: next

    5 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. java.sql.SQLException

      Cannot perform fetch on a PLSQL statement: next

      at oracle.jdbc.driver.SQLStateMapping.newSQLException()
    2. Oracle jdbc
      OracleResultSetImpl.next
      1. oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70)
      2. oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133)
      3. oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199)
      4. oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:263)
      5. oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:271)
      6. oracle.jdbc.driver.OracleResultSetImpl.next(OracleResultSetImpl.java:209)
      6 frames
    3. Hibernate
      SQLQueryImpl.list
      1. org.hibernate.loader.Loader.processResultSet(Loader.java:938)
      2. org.hibernate.loader.Loader.doQuery(Loader.java:910)
      3. org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:341)
      4. org.hibernate.loader.Loader.doList(Loader.java:2516)
      5. org.hibernate.loader.Loader.doList(Loader.java:2502)
      6. org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2332)
      7. org.hibernate.loader.Loader.list(Loader.java:2327)
      8. org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:338)
      9. org.hibernate.internal.SessionImpl.listCustomQuery(SessionImpl.java:1788)
      10. org.hibernate.internal.AbstractSessionImpl.list(AbstractSessionImpl.java:231)
      11. org.hibernate.internal.SQLQueryImpl.list(SQLQueryImpl.java:157)
      11 frames
    4. org.hibernate.test
      CustomStoredProcTestSupport.testEntityStoredProcedure
      1. org.hibernate.test.sql.hand.custom.CustomStoredProcTestSupport.testEntityStoredProcedure(CustomStoredProcTestSupport.java:100)
      1 frame
    5. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:601)
      4 frames
    6. JUnit
      FrameworkMethod.invokeExplosively
      1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
      2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
      3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
      3 frames
    7. A Hibernate O/RM Module
      ExtendedFrameworkMethod.invokeExplosively
      1. org.hibernate.testing.junit4.ExtendedFrameworkMethod.invokeExplosively(ExtendedFrameworkMethod.java:63)
      1 frame
    8. JUnit
      FailOnTimeout$StatementThread.run
      1. org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
      2. org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
      3. org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
      4. org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:62)
      4 frames