-->
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: Problem using MaxResults
PostPosted: Mon Nov 28, 2005 10:54 am 
Newbie

Joined: Fri Jun 24, 2005 5:34 am
Posts: 18
Hibernate version:
3.0

The generated SQL:
[11/28/05 15:38:19:828 CET] 5346dc97 SystemOut O Hibernate: select top 8006 tsupplier0_.SupplierID as SupplierID3_, tsupplier0_.Name as Name3_, tsupplier0_.Fax as Fax3_ from v_Supplier tsupplier0_ where (tsupplier0_.Name is not null) and len(ltrim(rtrim(tsupplier0_.Name)))>0 order by tsupplier0_.Name

I get :
[11/28/05 15:38:20:028 CET] 5346dc97 StaleConnecti A CONM7007I: Mapping the following SQLException, with ErrorCode 16,902 and SQLState S1000, to a StaleConnectionException: java.sql.SQLException: sp_cursorfetch: The value of parameter 'nrows' is invalid.


[11/28/05 15:38:20:138 CET] 5346dc97 JDBCException W org.hibernate.util.JDBCExceptionReporter SQL Error: 16902, SQLState: S1000
[11/28/05 15:38:20:158 CET] 5346dc97 JDBCException E org.hibernate.util.JDBCExceptionReporter sp_cursorfetch: The value of parameter 'nrows' is invalid.



I'm on a SQL Server 2000.

This is my java code :

Code:
String req = "FROM TSupplier supplier "
                    + " WHERE supplier.name is not null "
                    + "AND LENGTH(TRIM(supplier.name)) > 0"
                    + "ORDER BY supplier.
// getting Deposit list.
Query q = HibernateUtils.getSession().createQuery(req);

q.setFirstResult( 50 ).setMaxResults(250);

List supList = q.list();


On my computer this work great. but when I deploy this on my server, I get this error :(


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.