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.  [ 2 posts ] 
Author Message
 Post subject: ValueList Handler pattern with Hibernate in JBoss
PostPosted: Tue Aug 10, 2004 11:53 pm 
Beginner
Beginner

Joined: Wed Jan 21, 2004 10:52 pm
Posts: 27
Location: Santa Cruz do Sul - RS - Brazil
Hi all,
Somebody has an example of a ValueList Handler implementation with the Hibernate in JBoss environment?
I try to modify the http://cvs.sourceforge.net/viewcvs.py/v ... iew=markup to use an Session Facade EJB (Stateless).
The problem is that in this implementation a session is remained open between scroll iterations. So, if I use a Session Facade EJB, the session is opened and closed between requests.

PS. To use EJB Statefull is discouraged because performance coast, no?

_________________
Do you still create DTO factories? Oh, no!
Try DTOptimzier now!
https://dtoptimizer.dev.java.net/


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 11, 2004 3:10 am 
Expert
Expert

Joined: Fri Feb 06, 2004 7:49 am
Posts: 255
Location: Moscow, Russia
what about usage of:
Code:
session.createQuery(hqlQuery)
    setFirstResult(startRow)
    .setMaxResults(MAX_ROW_NUM)
    .list();


And if you need session with its filled first-level cache, to avoid repeated fetches, use Statefull Bean with the following approach:
Code:
this.session.reconnect(); // or this.session.connect(newJDBCConnection)
// iterate....
List result = this.session.createQuery(hqlQuery)
    setFirstResult(startRow)
    .setMaxResults(MAX_ROW_NUM)
    .list();
this.session.disconnect();

return result;


Or think about second-level caching.

_________________
Leonid Shlyapnikov


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.