-->
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: Pagination with DetachedQuery?
PostPosted: Tue May 31, 2005 8:25 pm 
Newbie

Joined: Tue Jan 11, 2005 2:26 pm
Posts: 15
Hi All,

I'm using Hibernate 3.0.2 and wondering how people are handling pagination?

I have a typical n-tierd application using Struts/Tiles on the front end,
a set of Manager classes for BL (might convert into Stateless session beans), DAO classes for HQL and DB beans for persistence.

I'm using the ThreadLocal Session pattern.

My transactions are managed at the Manager class level.

I was thinking of using a DetachedQuery to implement pagination of a result set.

Is this a good idea? Is there a better/more common way of implementing this with Hibernate 3.0.2?

Thanks,
-Ben


Top
 Profile  
 
 Post subject: Pagination through different sessions
PostPosted: Thu Dec 15, 2005 3:45 pm 
Newbie

Joined: Sat Sep 17, 2005 4:05 am
Posts: 3
I have basically the same question:

Pagination through different sessions

Can someone please help us with this small alteration of the common pagination pattern:

this.query = Hibernate.getSession().createFilter(order.items, "");
this.query.setMaxResults(Main.fetchSize);
results.fill(query.list());

/// ...
open new session
/// ...

Hibernate.getSession().lock(order,LockMode.NONE);// to reattach items too
this.query.setFirstResult(last).setMaxResults(Main.fetchSize);
results.fill(query.list());

throws Exception : The collection was unreferenced

How can we solve this? All comments are appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 02, 2006 6:28 pm 
Newbie

Joined: Tue Feb 21, 2006 4:29 pm
Posts: 4
J'ai le meme probleme. Certains suggerent de garder l'object Query/Criteria du cote de Struts (ActionForm possiblement) et de le passer a la couche business. Cela dit je suis pas tout a fait satisfait a l'idee d'importer les classes Hibernate du cote de la couche presentation. Je me demande quel pattern d'autre utilisateurs auraient utiliser dans leur project? Une solution est de conserver les parametres de recherche et de reconstruire a chaque iteration la requete SQL, mais bon il doit y avoir une meilleur solution...


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.