At 10:03 14.11.00 , you wrote:
>Every single one of those calls to dir.getXXX() has to go across
>the network via RMI. This is slow. You are better off using a
well, with orion this is intra-vm so its not that bad ...
>bulk accessor pattern. For example, create a new class called
.. although a bulk accessor is generally a good thing to use in such
situations.
have you tried wrapping one usertransaction around your update operation or
maybe even around the entire loop, depending on what you want to see as a
transaction. this will improve performance significantly because you don't
have all the tx overhead. if you don't know what a usertransaction is, read
up on JTA.
HTH
robert
>DirView which contains all the attributes of your Dir EJB. Then
>make a single call to the Dir EJB to get a DirView. This will cause
>only 1 RMI call and save you a huge amount of time.
>
>Do you understand? I can probably pseudo-code an example
>if necessary.
>
>-tim
>
>
>>-----Original Message-----
>>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
>>Sent: Tuesday, November 14, 2000 3:56 AM
>>To: Orion-Interest
>>Subject: EJB Performance Question.
>>
>>Hi, every one. First i'm sorry for my english.
>>
>>We use servlet that call EJB. Next is code fraction.
>>
>>//---------------------------------------------------
>>public Vector findByFirstPage(DirHome home, Integer rowCount) throws
>>Exception{
>>
>> Vector rows = new Vector();
>> Dir dir = null;
>>
>> System.out.println("step 11 time : " + (new java.util.Date()));
>>
>> // call EJB
>> Collection col = home.findByFirstPage(rowCount.intValue());
>> Iterator iter = col.iterator();
>>
>> System.out.println("step 12 time : " + (new java.util.Date()));
>>
>> while(iter.hasNext()) {
>> dir = (Dir)iter.next();
>> rows.add(EJBToRow(dir)); //<------- #### bottle neck #####
>> }
>>
>> System.out.println("step 13 time : " + (new java.util.Date()));
>>
>> return rows;
>>
>> }
>> //---------------------------------------------------
>>
>>
>>Simple code. In while loop, EJBToRow() method take 3 second each call.
>>
>>Next code is EJBToRow(). Very Simple. Only call EJB Meber methods.
>>
>> //---------------------------------------------------
>> public Vector EJBToRow(Dir dir) throws Exception {
>>
>> Vector row = new Vector();
>>
>>System.out.println("step 21 time : " + (new java.util.Date()));
>>
>> row.add(dir.getId());
>> row.add(new Long(dir.getPId()));
>> row.add(dir.getName());
>> row.add(new Long(dir.getSerial()));
>> row.add(new Long(dir.getChildCount()));
>> row.add(new Long(dir.getDepth()));
>> row.add(dir.getPMap());
>> row.add(dir.getType());
>> row.add(dir.getUserId());
>> row.add(dir.getGroupId());
>> row.add(dir.getOwnerPermR());
>> row.add(dir.getOwnerPermW());
>> row.add(dir.getOwnerPermX());
>> row.add(dir.getGroupPermR());
>> row.add(dir.getGroupPermW());
>> row.add(dir.getGroupPermX());
>> row.add(dir.getOtherPermR());
>> row.add(dir.getOtherPermW());
>> row.add(dir.getOtherPermX());
>> row.add(dir.getCreateDate());
>> row.add(dir.getUpdateDate());
>> row.add(dir.getExpireDate());
>> row.add(dir.getRemark());
>>
>>System.out.println("step 22 time : " + (new java.util.Date()));
>>
>> return row;
>>
>> }
>> //---------------------------------------------------
>>
>>What's the key problem?
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>----------
>>e-mail
>>site
>>: <mailto:[EMAIL PROTECTED]>[EMAIL PROTECTED]
>>: www.javanuri.com
>>��ȭ
>>mobile
>>: 02-6257-3002
>>: 019-255-2855
>>
>>
>>
>>----------
>>
(-) Robert Kr�ger
(-) SIGNAL 7 Gesellschaft f�r Informationstechnologie mbH
(-) Br�der-Knau�-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665401, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de