org.hibernate.exception.GenericJDBCException: unable to select generated column values

Hibernate JIRA | Stanislav Zaluzhskiy | 5 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    In my project I use specific NamingStrategy (org.hibernate.cfg.NamingStrategy). Each column name is wrapped by quotas - _dialect.openQuote() + columnName + _dialect.closeQuote(). Then I try to use a @Formula with one of the property: @Formula("(select sum(s.\"prodCount\") from SensorEntry as s where s.\"job_id\" = \"id\")") private Long value; This transforms into: select sum(s.job_."prodCount") from SensorEntry as s where s.job_."job_id" = job_."id") as formula24_ Which leads to exception: 19:18:37,268 WARN main JDBCExceptionReporter:100 - SQL Error: 0, SQLState: 3F000 19:18:37,269 ERROR main JDBCExceptionReporter:101 - ERROR: schema "s" does not exist 19:18:37,270 ERROR main AbstractFlushingEventListener:324 - Could not synchronize database state with session org.hibernate.exception.GenericJDBCException: unable to select generated column values at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.persister.entity.AbstractEntityPersister.processGeneratedProperties(AbstractEntityPersister.java:3754) at org.hibernate.persister.entity.AbstractEntityPersister.processInsertGeneratedProperties(AbstractEntityPersister.java:3703) at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:89) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) I suppose that this is because quota literals don't escaped correctly by Hibernate.

    Hibernate JIRA | 5 years ago | Stanislav Zaluzhskiy
    org.hibernate.exception.GenericJDBCException: unable to select generated column values
  2. 0

    In my project I use specific NamingStrategy (org.hibernate.cfg.NamingStrategy). Each column name is wrapped by quotas - _dialect.openQuote() + columnName + _dialect.closeQuote(). Then I try to use a @Formula with one of the property: @Formula("(select sum(s.\"prodCount\") from SensorEntry as s where s.\"job_id\" = \"id\")") private Long value; This transforms into: select sum(s.job_."prodCount") from SensorEntry as s where s.job_."job_id" = job_."id") as formula24_ Which leads to exception: 19:18:37,268 WARN main JDBCExceptionReporter:100 - SQL Error: 0, SQLState: 3F000 19:18:37,269 ERROR main JDBCExceptionReporter:101 - ERROR: schema "s" does not exist 19:18:37,270 ERROR main AbstractFlushingEventListener:324 - Could not synchronize database state with session org.hibernate.exception.GenericJDBCException: unable to select generated column values at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.persister.entity.AbstractEntityPersister.processGeneratedProperties(AbstractEntityPersister.java:3754) at org.hibernate.persister.entity.AbstractEntityPersister.processInsertGeneratedProperties(AbstractEntityPersister.java:3703) at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:89) at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279) I suppose that this is because quota literals don't escaped correctly by Hibernate.

    Hibernate JIRA | 5 years ago | Stanislav Zaluzhskiy
    org.hibernate.exception.GenericJDBCException: unable to select generated column values
  3. 0

    Error SQLCODE "-811", SQLSTATE "21000"

    dbaspot.com | 1 year ago
    org.hibernate.exception.GenericJDBCException: could not insert: [ca.olgc.proline.domain.PropDO] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:82) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:70) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:1869) at org.hibernate.persister.entity.BasicEntityPersister.insert(BasicEntityPersister.java:2200) at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:46)
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Apache Derby Users Mailing List

    gmane.org | 1 year ago
    org.hibernate.exception.GenericJDBCException: could not insert: [com.myproject.lifecycle.persistence.entity.ServiceHost] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2267) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2660) at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:56)
  6. 0

    itracker / Mailing Lists

    sourceforge.net | 1 year ago
    org.hibernate.exception.GenericJDBCException: could not insert: [org.itracker.model.IssueHistory] at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:40) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2163) at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2643) at org.hibernate.action.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:51)

    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

      unable to select generated column values

      at org.hibernate.exception.SQLStateConverter.handledNonSpecificException()
    2. Hibernate
      AbstractEntityPersister.processInsertGeneratedProperties
      1. org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
      2. org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
      3. org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
      4. org.hibernate.persister.entity.AbstractEntityPersister.processGeneratedProperties(AbstractEntityPersister.java:3754)
      5. org.hibernate.persister.entity.AbstractEntityPersister.processInsertGeneratedProperties(AbstractEntityPersister.java:3703)
      5 frames
    3. Hibernate
      EntityInsertAction.execute
      1. org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:89)
      1 frame
    4. Hibernate
      ActionQueue.execute
      1. org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
      1 frame