Hello, i have a CMP entity bean called PPrompt with a ejbSelect method (in
Remote or in Local, the problem is the same ;) )
In my Session bean, i have a function that returns all the prompts of an
environement.
So i get all the bean, iterate on all the bean in order to extract the "data" i
need (generally all fields, but in this case i have just one)
/**
* Gets all the Prompts
* @return a Collection of PromptData.
*
* @ejb.interface-method
* view-type="remote"
*/
public Collection getAllPromptsWithThisEnv(String envName) throws
FinderException, RemoteException {
ArrayList result = new ArrayList();
System.out.println(" <mgr.getAllPrompts With
this env DB: START>");
Collection promptsLocal =
promptHome.getAllPromptsInEnv(envName);
System.out.println(" <mgr.getAllPrompts With
this env DB: END>");
System.out.println(" <mgr.getAllPrompts
ITERATOR: START>");
Iterator it = promptsLocal.iterator();
while (it.hasNext()) {
PPrompt prompt = (PPrompt) it.next();
result.add(prompt.getPromptId());
}
System.out.println(" <mgr.getAllPrompts
ITERATOR: END>");
System.out.println(" <mgr.getAllPrompts
SORTED: START>");
//Collections.sort(result, new
PPromptComparatorWithGroupName());
System.out.println(" <mgr.getAllPrompts
SORTED: END>");
return result;
}
The time for get 800 prompts take 1.1 sec, i think it is not normal
The console said:
14:41:23,133 INFO [STDOUT] <mgr.getAllPrompts With this
env DB: START>
14:41:23,180 INFO [STDOUT] <mgr.getAllPrompts With this
env DB: END>
14:41:23,180 INFO [STDOUT] <mgr.getAllPrompts ITERATOR:
START>
14:41:24,246 INFO [STDOUT] <mgr.getAllPrompts ITERATOR:
END>
14:41:24,247 INFO [STDOUT] <mgr.getAllPrompts SORTED:
START>
14:41:24,247 INFO [STDOUT] <mgr.getAllPrompts SORTED: END>
=> 1sec for 800 getId() !!!!!!!!!!!!!
if i use another getters, it takes the same time
if i try just to put in the vector a string, it takes 1ms
please help !!!
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3882096#3882096
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3882096
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user