Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.3.1.GA
Full stack trace of any exception that occurs:
Code:
ERROR 15:38:06 0 could not read a hi value (TableStructure.java:140)
org.postgresql.util.PSQLException: ERROR: syntax error at or near "id_val"
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:437)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:353)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:257)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
at org.hibernate.id.enhanced.TableStructure.doWorkInCurrentTransaction(TableStructure.java:130)
at org.hibernate.engine.TransactionHelper$1Work.doWork(TransactionHelper.java:61)
at org.hibernate.engine.transaction.Isolater$JdbcDelegate.delegateWork(Isolater.java:211)
at org.hibernate.engine.transaction.Isolater.doIsolatedWork(Isolater.java:67)
at org.hibernate.engine.TransactionHelper.doWorkInNewTransaction(TransactionHelper.java:74)
at org.hibernate.id.enhanced.TableStructure$1.getNextValue(TableStructure.java:98)
at org.hibernate.id.enhanced.OptimizerFactory$PooledOptimizer.generate(OptimizerFactory.java:197)
at org.hibernate.id.enhanced.SequenceStyleGenerator.generate(SequenceStyleGenerator.java:181)
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:122)
at org.hibernate.event.def.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:154)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:110)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:61)
at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:645)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:619)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:623)
Name and version of the database you are using:
PostgreSQL 8.3
The generated SQL (show_sql=true):
select next_val id_val from hibernate_sequence for update;
We using
org.hibernate.id.enhanced.SequenceStyleGenerator for IDGenerator. And get the error, that "syntax error at or near "id_val", and we found this from Postgres dokumentation,
In the SQL92 standard, the optional keyword AS is just noise and can be omitted without affecting the meaning. The PostgreSQL parser requires this keyword when renaming output columns because the type extensibility features lead to parsing ambiguities in this context. AS is optional in FROM items, however.
The problem is in the constructor by the class org.hibernate.id.enhanced.TableStructure.
Can you tell us, how can we fix this problem, thank you.