on you finder use a read-ahead strategy on-find or on-load + a load-group
that contains only the field you need to load.

with latest xdoclet :

 * @jboss.query
 *    signature="java.util.Collection findSomething()"
 *    strategy="on-load"
 *    page-size="10"
 *    eager-load-group="lightweight"
 *
 * @jboss.load-group
 *    name="lightweight"
 *

 plus on each cmp field that needs to be loaded you tag :

 * @jboss.load-group
 *    name="lightweight"
 

 this configuration will load entities by bunch of 10.
 

julien

PB> Hi,
PB> My application frequently needs to grab a large number of entities from
PB> the database to populate drop down lists.

PB> The current method I use, is to use a CMP finder which returns a bunch
PB> of entities.  I then iterate through the list grabbing the values I need
PB> to populate the list.

PB> But, it is too slow!

PB> I usually need only two fields from each entity, and the overhead of
PB> converting each row into a bean is high.

PB> I am using the read-ahead optimisation.

PB> My only option to speed this up seems to be a SQL+JDBC solution.

PB> Does anyone have any better suggestions for me?

PB> Thanks,
PB> Pete




-- 
Best regards,
 julien                            mailto:[EMAIL PROTECTED]

___________________________________________________________
Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et en français !
Yahoo! Mail : http://fr.mail.yahoo.com


-------------------------------------------------------
This SF.net email is sponsored by: Does your code think in ink? 
You could win a Tablet PC. Get a free Tablet PC hat just for playing. 
What are you waiting for?
http://ads.sourceforge.net/cgi-bin/redirect.pl?micr5043en
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to