I think the reason (or maybe just one of them) for the query sent is the assumption that you might not read all the records all the time but only a few at a time, youBut I want read alle entries. And I have the problem with the query which is created by JBoss. I need all entries to generate for every a xml file which will be send to other application. and this will be done for every entry in some tables. I have two solutions:
- SQL
- EJB
but I don't want use SQL code in my application.
while calling findAll() JBoss are sending first query to get all id's. now comes n queries. and why is JBoss not sending for each id one query? JBoss sends in the fist call all id's linked by 'or' operator. in the secodn there are n-1 id's and so long.
Rafal
might even stop reading them in the middle of your processing:
Collection c = yourBeanHome.findAll ();
// Suppose this returns 2000 records after executing // SQL with no where (id = ?) or (id = ?)
Iterator i = c.iterator ();
int counter = 0;
while (i.hasNext ()) { YourBean yb = (YourBean) i.next ();
if (counter > 5) { break; }
counter ++;
}
So in the scenario above you actually retireved only five records. If you were not to have that strange
where statement in your SQL, you would waste creation
of exactly 1995 records. But since you did have it you only wasted the retrieval of your ids and <page-size> - 5 records. JBoss lets you manage this situation thru that where and the settings in the jbosscmp-jdbc.xml
<read-ahead> <strategy>on-load</strategy> <page-size>1000</page-size> <eager-load-group>*</eager-load-group> </read-ahead>
------------------------------------------------------- This SF.net email is sponsored by: Scholarships for Techies! Can't afford IT training? All 2003 ictp students receive scholarships. Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more. www.ictp.com/training/sourceforge.asp _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user