Hello all,
I am facing the following exception while using the hibernate with postgresql what may be the problem. While i connect with MySQl its perfect.bcoz for mysql the table name start with "_".for postgre sql table name starts with ".." .
Hibernate: select this_.durationID as durationID0_, this_.ruleinfoID as ruleinfoID13_0_, this_.itemID as itemID13_0_, this_.flag as flag13_0_ from ..duration_log this_
com.mchange.v2.c3p0.impl.NewPooledConnection@7ff5b6 invalidated by Exception: org.postgresql.util.PSQLException: ERROR: syntax error at or near "."
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:254)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:75)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:120)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1272)
at org.hibernate.loader.Loader.doQuery(Loader.java:391)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
at org.hibernate.loader.Loader.doList(Loader.java:1593)
at org.hibernate.loader.Loader.list(Loader.java:1577)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:111)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1322)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:300)
at com.propel.PropelHost.a.c.getDurationItems(Unknown Source)
at com.propel.PropelHost.a.g.getDurationItems(Unknown Source)
at com.propel.PropelHost.reactor.a.q.processDurationItem(Unknown Source)
at com.propel.PropelHost.reactor.e.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
CONNECTION ERROR OCCURRED!
[15 Apr 2008 11:30:39] WARN - SQL Error: 0, SQLState: 42601
[15 Apr 2008 11:30:39] ERROR - ERROR: syntax error at or near "."
org.hibernate.exception.SQLGrammarException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:59)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:1596)
at org.hibernate.loader.Loader.list(Loader.java:1577)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:111)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1322)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:300)
at com.propel.PropelHost.a.c.getDurationItems(Unknown Source)
at com.propel.PropelHost.a.g.getDurationItems(Unknown Source)
at com.propel.PropelHost.reactor.a.q.processDurationItem(Unknown Source)
at com.propel.PropelHost.reactor.e.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "."
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:254)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:75)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:120)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1272)
at org.hibernate.loader.Loader.doQuery(Loader.java:391)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
at org.hibernate.loader.Loader.doList(Loader.java:1593)
... 9 more
Hibernate: select this_.ruleID as ruleID1_, this_.name as name36_1_, this_.ruletypeID as ruletypeID36_1_, this_.companyID as companyID36_1_, this_.xml as xml36_1_, ruletype2_.id as id0_, ruletype2_.name as name42_0_ from ..rule this_ inner join ..ruletype ruletype2_ on this_.ruletypeID=ruletype2_.id
com.mchange.v2.c3p0.impl.NewPooledConnection@1c64ed8 invalidated by Exception: org.postgresql.util.PSQLException: ERROR: syntax error at or near "."
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1327)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:192)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:451)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:350)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:254)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:75)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:120)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1272)
at org.hibernate.loader.Loader.doQuery(Loader.java:391)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:218)
at org.hibernate.loader.Loader.doList(Loader.java:1593)
at org.hibernate.loader.Loader.list(Loader.java:1577)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:111)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1322)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:300)
at com.propel.PropelHost.a.c.getRule(Unknown Source)
at com.propel.PropelHost.a.g.getRule(Unknown Source)
at com.propel.PropelHost.reactor.a.q.processDurationRulesStaysAt(Unknown Source)
at com.propel.PropelHost.reactor.e.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
CONNECTION ERROR OCCURRED!
|