-->
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.  [ 3 posts ] 
Author Message
 Post subject: error in query.getResultList()
PostPosted: Fri Feb 01, 2013 1:17 pm 
Newbie

Joined: Fri Feb 01, 2013 1:00 pm
Posts: 2
Hi,

I've two projects with the same implementation, however,
a project I can use the query successfully, the other throws this exception.
In both projects the table contains 10 records.
I use this for lazy dataTable of primefaces.

Code:
public List<Entity> findAllLimit(String namedQuery, Map parameters,Integer startResults, Integer maxPerPage) throws Exception{
      Query query = replaceParameters(namedQuery, parameters);
      query.setFirstResult(startResults);
      query.setMaxResults(maxPerPage);
      List resultList = query.getResultList();
      return resultList;
}


Please i need help!!

thanks.


Top
 Profile  
 
 Post subject: Re: error in query.getResultList()
PostPosted: Mon Feb 04, 2013 7:20 am 
Hibernate Team
Hibernate Team

Joined: Fri Sep 09, 2011 3:18 am
Posts: 295
Hi,
Where is the exception? I can't see it


Top
 Profile  
 
 Post subject: Re: error in query.getResultList()
PostPosted: Mon Feb 04, 2013 7:44 am 
Newbie

Joined: Fri Feb 01, 2013 1:00 pm
Posts: 2
davided80 wrote:
Hi,
Where is the exception? I can't see it

Code:
09:39:50,062 ERROR [stderr] (http-localhost-127.0.0.1-8080-2)    at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:252)

09:39:50,063 ERROR [stderr] (http-localhost-127.0.0.1-8080-2)    ... 117 more

09:39:50,063 ERROR [stderr] (http-localhost-127.0.0.1-8080-2) Caused by: java.sql.SQLException: ResultSet may only be accessed in a forward direction.


I solved with this line into persistence.xml
Code:
<property name="hibernate.jdbc.use_scrollable_resultset"
            value="false" />


Thank you!


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

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.