[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3177) SetMaxResults with db2 database problem

Gail Badner (JIRA) noreply at atlassian.com
Thu Sep 18 16:26:05 EDT 2008


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=31238#action_31238 ] 

Gail Badner commented on HHH-3177:
----------------------------------

Irena, did any of the DB2 dialects work for you?

> SetMaxResults with db2 database problem
> ---------------------------------------
>
>                 Key: HHH-3177
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3177
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>         Environment: hibernate3.2.0.ga,  DB2 8.2.1
>            Reporter: Irena
>
> Trying to do simple thing:
> List<Subject> subjects = (List<Subject>) currSession.createQuery("from Subject").setMaxResults(10).list();
> this prings fallowing: 
> WARN JDBCExceptionReporter:71 - SQL Error: -104, SQLState: 42601
> ERROR JDBCExceptionReporter:72 - DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: 10;select top ;.
> WARN JDBCExceptionReporter:71 - SQL Error: -727, SQLState: 56098
> ERROR JDBCExceptionReporter:72 - DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-104;42601;10|select top |.
> WARN JDBCExceptionReporter:71 - SQL Error: -727, SQLState: 56098
> ERROR JDBCExceptionReporter:72 - DB2 SQL error: SQLCODE: -727, SQLSTATE: 56098, SQLERRMC: 2;-104;42601;10|select top |.
> Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not execute query
> 	at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
> 	at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
> 	at org.hibernate.loader.Loader.doList(Loader.java:2147)
> 	at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2028)
> 	at org.hibernate.loader.Loader.list(Loader.java:2023)
> 	at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:393)
> 	at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
> 	at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
> 	at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
> 	at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
> 	at ru.nbch.quality.logic.ReportProcessor.main(ReportProcessor.java:66)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
> Caused by: com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -104, SQLSTATE: 42601, SQLERRMC: 10;select top ;.
> 	at com.ibm.db2.jcc.b.id.e(id.java:1640)
> 	at com.ibm.db2.jcc.b.id.a(id.java:1229)
> 	at com.ibm.db2.jcc.c.fb.h(fb.java:149)
> 	at com.ibm.db2.jcc.c.fb.a(fb.java:43)
> 	at com.ibm.db2.jcc.c.s.a(s.java:30)
> 	at com.ibm.db2.jcc.c.wb.g(wb.java:152)
> 	at com.ibm.db2.jcc.b.id.n(id.java:1209)
> 	at com.ibm.db2.jcc.b.jd.eb(jd.java:1779)
> 	at com.ibm.db2.jcc.b.jd.a(jd.java:2232)
> 	at com.ibm.db2.jcc.b.jd.V(jd.java:505)
> 	at com.ibm.db2.jcc.b.jd.executeQuery(jd.java:488)
> 	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
> 	at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
> 	at org.hibernate.loader.Loader.getResultSet(Loader.java:1668)
> 	at org.hibernate.loader.Loader.doQuery(Loader.java:662)
> 	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
> 	at org.hibernate.loader.Loader.doList(Loader.java:2144)
> 	... 13 more

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list