2 Replies Latest reply on Jun 6, 2013 9:18 AM by shuron

    AuthQuery produces SQL Error: 17023, SQLState: 99999 and "Unsupported feature: getCursorName"

    Newbie

      Queryung the Envers history results in strange Exceptions See below.

       

      How query is Builded:

       

      AuditReader reader = AuditReaderFactory.get(em);

              AuditQuery query = reader.createQuery().forRevisionsOfEntity(Antrag.class, false, true)

                      .add(AuditEntity.id().eq(id));

       

              List<Object[]> audits = query.getResultList();

       

       

      Results in:

      ....

      14:58:28,828 INFO  [stdout] (http-/0.0.0.0:8080-2) Hibernate: select persondata0_.id as id297_, persondata0_.REV as REV297_, persondata0_.REVTYPE as REVTYPE297_, persondata0_.AUFENTH_TEXT as AUFENTH4_297_, persondata0_.AUFENTH as AUFENTH297_, persondata0_.AUSTR_DAT_TEXT as AUSTR6_297_, persondata0_.AUSTR_DAT as AUSTR7_297_, persondata0_.SBPRO_TEXT as SBPRO8_297_, persondata0_.SBPRO as SBPRO297_, persondata0_.CHECK_AUSL as CHECK10_297_, persondata0_.NATIO_TEXT as NATIO11_297_, persondata0_.NATIO as NATIO297_ from PERSON_DATA_AUD persondata0_ where persondata0_.REV=(select max(persondata1_.REV) from PERSON_DATA_AUD persondata1_ where persondata1_.REV<=? and persondata0_.id=persondata1_.id) and persondata0_.REVTYPE<>? and persondata0_.id=?

       

      14:58:29,639 WARN  [org.hibernate.engine.jdbc.internal.JdbcResourceRegistryImpl] (http-/0.0.0.0:8080-2) HHH000387: ResultSet's statement was not registered

      14:58:29,654 WARN  [org.hibernate.engine.jdbc.internal.JdbcResourceRegistryImpl] (http-/0.0.0.0:8080-2) HHH000387: ResultSet's statement was not registered

      14:58:29,686 WARN  [org.hibernate.engine.jdbc.internal.JdbcResourceRegistryImpl] (http-/0.0.0.0:8080-2) HHH000387: ResultSet's statement was not registered

      14:58:29,701 WARN  [org.hibernate.engine.jdbc.internal.JdbcResourceRegistryImpl] (http-/0.0.0.0:8080-2) HHH000387: ResultSet's statement was not registered

      14:58:29,718 WARN  [org.hibernate.engine.jdbc.internal.JdbcResourceRegistryImpl] (http-/0.0.0.0:8080-2) HHH000387: ResultSet's statement was not registered

      14:58:29,749 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-/0.0.0.0:8080-2) SQL Error: 17023, SQLState: 99999

      14:58:29,749 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-/0.0.0.0:8080-2) Unsupported feature: getCursorName

      14:58:29,749 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-/0.0.0.0:8080-2) SQL Error: 17075, SQLState: 99999

      14:58:29,749 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-/0.0.0.0:8080-2) Invalid operation for forward only resultset : isLast

      14:58:29,749 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-/0.0.0.0:8080-2) SQL Error: 17090, SQLState: 99999

      14:58:29,749 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-/0.0.0.0:8080-2) operation not allowed

      14:58:29,749 WARN  [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-/0.0.0.0:8080-2) SQL Error: 17023, SQLState: 99999

      14:58:29,749 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-/0.0.0.0:8080-2) Unsupported feature: getCursorName

      ...

       

      see attached file for more...

       

      This seems also not releasing connections, and therefore the system get's running out of them quickly...

       

      Design:

      There are annotated Entities with  @OneToOne relation only (@JoinColumn). Just one Envers Annotation is used: @Audited

       

      System:

      JBoss EAP 6.0 (Seemes to include Hibernate Envers 4.1.2-Final)

      DB Oracle 11.2

       

      Any ideas?

      Why Envers generates such incompatible queries?