Are you trying to say that you iterate over all of the cmr's in the iterate. If you are, there is little that can be done. The current read ahead code does not support reading ahead across relationships on-find in response to a query. I suggest you try OptimizeIt to make sure, but I would guess that you are getting 5 queries per loop.

-dain

Gene Ge wrote:
iterator extremely slow problem

Because I found my search was very slow, so I made a simple test:

code:*************************************************************************************

......

System.out.println("====before findAll. time is"+new Date().getTime());

Iterator graduates=graduateHome.findAll().iterator();

System.out.println("====after findAll. time is"+new Date().getTime()+" size="+graduateHome.findAll().size());

long interval=0;
long oldtime=0;

System.out.println("====begin while. time is"+new Date().getTime());

while(graduates.hasNext()){
graduate=(GraduateLocal) graduates.next();
interval=new Date().getTime()-oldtime;
oldtime=new Date().getTime();
System.out.println("====in while. interval is"+interval);
System.out.println("====graduate is "+graduate.getStudent().getName());
}
System.out.println("====after while. time is"+new Date().getTime());


code end******************************************************************************

the output is:************************************************************************
18:12:43,625 INFO [STDOUT] ====before findAll. time is1036577563625
18:12:44,406 INFO [STDOUT] ====after findAll. time is1036577563968 size=1804
18:12:44,421 INFO [STDOUT] ====begin while. time is1036577564421
18:12:44,421 INFO [STDOUT] ====in while. interval is1036577564421
18:12:50,562 INFO [STDOUT] ====graduate is ���
18:12:50,562 INFO [STDOUT] ====in while. interval is6141
18:12:56,343 INFO [STDOUT] ====graduate is �� ��
18:12:56,343 INFO [STDOUT] ====in while. interval is5781
18:13:02,484 INFO [STDOUT] ====graduate is ������
18:13:02,484 INFO [STDOUT] ====in while. interval is6141
18:13:08,328 INFO [STDOUT] ====graduate is �� ά
18:13:08,328 INFO [STDOUT] ====in while. interval is5844
18:13:14,437 INFO [STDOUT] ====graduate is ���
18:13:14,437 INFO [STDOUT] ====in while. interval is6109
18:13:20,171 INFO [STDOUT] ====graduate is �� ��
18:13:20,171 INFO [STDOUT] ====in while. interval is5734
18:13:26,187 INFO [STDOUT] ====graduate is �� ��
18:13:26,218 INFO [STDOUT] ====in while. interval is6047
18:13:32,000 INFO [STDOUT] ====graduate is �� ��
18:13:32,015 INFO [STDOUT] ====in while. interval is5797
18:13:37,687 INFO [STDOUT] ====graduate is �� ��
18:13:37,703 INFO [STDOUT] ====in while. interval is5688
......
...
******************************************************************************************

Graduate is a CMP Bean with 5 attributes and 5 CMRs map table includes about 18000 rows use Microsoft SQLServer JDBC Driver. Connection properties has "selectMethod=cursor".
the CMT type is "Supports"
this test is invoked in a struts Action without any transaction.

So, how can I deal with it?
any help is appreciated.

Gene

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail



-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

--
xxxxxxxxxxxxxxxxxxxxxxxx
Dain Sundstrom
Chief Architect JBossCMP
JBoss Group, LLC
xxxxxxxxxxxxxxxxxxxxxxxx



-------------------------------------------------------
This sf.net email is sponsored by: See the NEW Palm Tungsten T handheld. Power & Color in a compact size!
http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to