5 Replies Latest reply: Mar 26, 2014 12:18 PM by sazz619 RSS

setAttribute causing performance issue.

sazz619 Newbie
Currently Being Moderated

Hi ,

 

I am using 11.1.1.4.0

 

Code:::

        DCIteratorBinding itr=ADFUtil.findIterator(iterator);

        RowSetIterator rsi=itr.getRowSetIterator();

       

        Row currRow=rsi.getCurrentRow();

       

        currRow.setAttribute(id,null);

 

If i call setAttribute multiple times(like 10-20 times) ,it causes severe performance issue .

Is there any reason for it ??

Should we avoid using setAttribute() ??If so then what we should use?

 

Any help is appreciated .

 

Thanks

Sazz

  • 1. Re: setAttribute causing performance issue.
    Timo Hahn Oracle ACE
    Currently Being Moderated

    Question: why do you do this?

    Why do you set the same attribute 30 times?

    Where do you execute this code?

     

    It would be easier to create an attribute binding for the id of the current row and set the attribute.

     

    Timo

  • 2. Re: setAttribute causing performance issue.
    Frank Nimphius Employee ACE
    Currently Being Moderated

    Hi,

     

    bottom line is this:

     

    If you call set attribute 30 times by a user clicking a command button 30 times then performance should not bother. If you call setAttribute 30 times in a single Java call then use case matters. So what is it you are trying to achieve?

     

    Frank

     

    Ps.: the call to Row currRow=rsi.getCurrentRow() is not needed because the methods are exposed on DCIterator as well

  • 3. Re: setAttribute causing performance issue.
    sazz619 Newbie
    Currently Being Moderated

    usecase is user wld see a existing vacancy record and able to update it.

    GEVacancyFromNotificationVO1()  is a query based vo and  getGETranVacancyVO1() is a updatable VO . Now using view criretia i am pulling the record in the updatable VO , this will have only 1 record at 1 time.

    GEVacancyFromNotificationVO1() gets the details and set then in attributes of the updatable VO as this VO includes many trasient attributes which are required in my jsff . Basicallly this data are not saved in DB but required to show in the UI.

    Anyways now the thing is setAttribute as called 20-30 times you see , the performance is slow and sometimes data is not set as well.

     

    I used attributeListImp class to create a name value pair and create a new row for this VO using createAndInitRow() and that works super fast . That is requied for another use case and works perfectly ok . Only when i want to update a existing record i have to update the same row. cant create another row, so facing this performance issue and sometime data doesnt set properly . i get null in DCiterator binding when i fetch the data in bean class.

    So my question is why does setAttribute of AttributeListImpl is much much faster than setAttribute of Row class.??

     

     

    public void initializeFromNotification(String role, String emp) {
           
            ViewObjectImpl notifyVO = this.getGEVacancyFromNotificationVO1();
            ViewObjectImpl transVO = this.getGETranVacancyVO1();
            ViewObjectImpl geLoginPersonIdVO = this.getGELoginPersonIdVO1();
            ViewObjectImpl autoPopulatevo =
                this.getGEAutopopulateHireSysforCopyVacanciesVO1();
            ViewObjectImpl geNextApproverVO = this.getGENextApproverVO1();
            ViewObjectImpl transHireVo = getGEHireSystemReqTeamTransVO1();
            ViewObjectImpl gejobdesc = getGEJobDescTransVO1();
            Row row = notifyVO.first();

            if (row != null) {
                //query the trx table

                transVO.setApplyViewCriteriaName("VacancyNumberVC");
                transVO.setNamedWhereClauseParam("p_vac_num",
                                                 row.getAttribute("VacancyNumber"));
                transVO.executeQuery();

                if (transVO.first() == null) {
                    return;
                } else {
                    transVO.setCurrentRow(transVO.first());
                }

                Row currentRow = transVO.getCurrentRow();
                List<String> transColumns =
                    Arrays.asList(currentRow.getAttributeNames());

                //setting values from notification vo to transvacancy VO
                String arr[] = row.getAttributeNames();
                if (null != transVO.getCurrentRow()) {

                    // AttributeListImpl attrList = new AttributeListImpl();
                    for (String attr : arr) {
                        if (row.getAttribute(attr) != null) {
                            if (attr.equalsIgnoreCase("VacTrxId")) {
                                ;
                            } else if (transColumns.contains(attr)) {
                                if (currentRow.getAttribute(attr) == null) {
                                    currentRow.setAttribute(attr,
                                                            row.getAttribute(attr).toString());
                                }
                            }
                        }
                    }
                }

                if (role != null && role.startsWith("ORG_MGR")) {
                    transVO.getCurrentRow().setAttribute("userRole",
                                                         "INITIATOR_HM");
                    transVO.getCurrentRow().setAttribute("userRoleDisplay",
                                                         "Hiring Manager");

                } else if (role != null && role.startsWith("HRM")) {
                    transVO.getCurrentRow().setAttribute("userRole",
                                                         "INITIATOR_HRM");
                    transVO.getCurrentRow().setAttribute("userRoleDisplay",
                                                         "HR Manager");

                } else {
                    transVO.getCurrentRow().setAttribute("userRole",
                                                         "INITIATOR_RFO");
                    transVO.getCurrentRow().setAttribute("userRoleDisplay", "RFO");
                }


                transVO.getCurrentRow().setAttribute("EmpNumber", emp);

                geLoginPersonIdVO.setNamedWhereClauseParam("sso", emp);
                geLoginPersonIdVO.executeQuery();
                transVO.getCurrentRow().setAttribute("userPersonId",
                                                     geLoginPersonIdVO.first().getAttribute(0));

    }

  • 4. Re: setAttribute causing performance issue.
    sazz619 Newbie
    Currently Being Moderated

    Any suggestions??

  • 5. Re: setAttribute causing performance issue.
    sazz619 Newbie
    Currently Being Moderated

    Could you please let me know what shld be done ?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points