-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Pb method setFirstResu setMaxResults of Criteria on DB2 z/os
PostPosted: Fri Feb 06, 2009 12:38 pm 
Newbie

Joined: Thu Feb 05, 2009 3:52 pm
Posts: 1
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3

Mapping documents:

Criteria requeteParCriteres = session.createCriteria (FluxA.class);
requeteParCriteres.add (Restrictions.eq (FluxA.IDFLUX_, idflux));
requeteParCriteres.setFirstResult (indexPremierEnregistrement);
RequeteParCriteres.setMaxResults (nbParPage);
ListePaiement list = (List) requeteParCriteres.list ();


Full stack trace of any exception that occurs:

DB2 V8:

Hibernate: select this_.NUMINTFI as NUMINTFI2_0_, this_.NUMINTFG as this_.MOISPREL as MOISPREL2_0_, this_.CODEPAYS as CODEPAYS2_0_, this_.MOTIFREJ as MOTIFREJ2_0_, this_.IBANCORR as IBANCORR2_0_, this_.JETON as JETON2_0_ from GDFFIDET this_ where this_.NUMINTFG=?
[06/02/09 17:31:18:262 CET] 00000018 WSRdbManagedC W DSRA0080E: Une exception a été reçue par Data Store Adapter. Voir le message de l'exception d'origine : com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -471, SQLSTATE: 55023, SQLERRMC: SYSIBM.SQLCAMESSAGE;00E7900C


SQLCODE: -904, SQLSTATE: 57011

Hello,
I want to retrieve only the (n) the first element
of a table from a certain index of departure (indexPremierEnregistrement).

I use methods setFirstResult and setMaxResults of Class Criteria.

It works on a DB2 on AIX
but when I pass on z / os, it will return an SQLCODE: -471, SQLSTATE: 55023, SQLERRMC: SYSIBM.SQLCAMESSAGE; 00E7900C if the value argument setFirstResult is different from 0 (see code below).

when the value passed as argument setFirstResult is 0, the setMaxResults has no effect and returns all rows instead of the number of the setMaxResults 's argument.

My bdd Db2 V8 is installed on z / os
org.hibernate.dialect.DB2Dialect with the dialect and Hibernate3.

Criteria requeteParCriteres = session.createCriteria (FluxA.class);
requeteParCriteres.add (Restrictions.eq (FluxA.IDFLUX_, idflux));
requeteParCriteres.setFirstResult (indexPremierEnregistrement);
RequeteParCriteres.setMaxResults (nbParPage);
ListePaiement list = (List) requeteParCriteres.list ();
Session.close ();

Something that he had the same problem?

Is a matter of dialect or driver or version of DB2?

Thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.