Hello folks,

please see below piece of code and output from FS log. As you can see, a code which uses just a simple "api_component.setEnable" executed 10 times take 7 seconds to run! That's too long, isn't it?

    PROCEDURE stazky_RW_grid(zo_stavu NUMBER,
                            do_stavu NUMBER) IS

      l_stazka_id NUMBER;

   BEGIN
      api_sys.api_debug_log('stazky_RW_grid.start do_stavu=' || do_stavu);
      l_stazka_id := api_datasource.getColumnValueNR('PJ_STAZKY1.OBJECT_ID');
      api_sys.api_debug_log('stazky_RW_grid  l_stazka_id=' || l_stazka_id);

      IF do_stavu = c_stav_stazky_OT THEN
         api_sys.api_debug_log('stazky_RW_grid  do_stavu = c_stav_stazky_OT');
         api_component.setEnable('tab-pj_stazky_jizdy.create', 'Y');
         api_component.setEnable('tab-pj_stazky_jizdy.edit', 'Y');
         api_component.setEnable('tab-pj_stazky_jizdy.delete', 'Y');
         api_component.setEnable('tab-pj_stazky_objed.create', 'Y');
         api_component.setEnable('tab-pj_stazky_objed.edit', 'Y');
         api_component.setEnable('tab-pj_stazky_objed.delete', 'Y');
         api_component.setEnable('tab-pj_stazky_stravne.create', 'N');
         api_component.setEnable('tab-pj_stazky_stravne.edit', 'N');
         api_component.setEnable('tab-pj_stazky_stravne.delete', 'N');

         api_component.setenable('tab-pj_stazky_stravne.btn-vypocetStravne', 'N');
      END IF;

      -- prechod mesice
      IF do_stavu = c_stav_stazky_PM THEN
         api_sys.api_debug_log('stazky_RW_grid  do_stavu = c_stav_stazky_PM');        
         api_component.setEnable('tab-pj_stazky_jizdy.create', 'N');
         api_component.setEnable('tab-pj_stazky_jizdy.edit', 'N');
         api_component.setEnable('tab-pj_stazky_jizdy.delete', 'N');
         api_component.setEnable('tab-pj_stazky_objed.create', 'N');
         api_component.setEnable('tab-pj_stazky_objed.edit', 'N');
         api_component.setEnable('tab-pj_stazky_objed.delete', 'N');
         api_component.setEnable('tab-pj_stazky_stravne.create', 'Y');
         api_component.setEnable('tab-pj_stazky_stravne.edit', 'Y');
         api_component.setEnable('tab-pj_stazky_stravne.delete', 'Y');

         api_component.setenable('tab-pj_stazky_stravne.btn-vypocetStravne', 'Y');
      END IF;

      -- data nahodene
      IF do_stavu = c_stav_stazky_DN OR do_stavu = c_stav_stazky_DN_BS THEN
         api_sys.api_debug_log('stazky_RW_grid  do_stavu = c_stav_stazky_DN resp. DN_BS');        
         api_component.setEnable('tab-pj_stazky_jizdy.create', 'N');
         api_component.setEnable('tab-pj_stazky_jizdy.edit', 'N');
         api_component.setEnable('tab-pj_stazky_jizdy.delete', 'N');
         api_component.setEnable('tab-pj_stazky_objed.create', 'N');
         api_component.setEnable('tab-pj_stazky_objed.edit', 'N');
         api_component.setEnable('tab-pj_stazky_objed.delete', 'N');
         api_component.setEnable('tab-pj_stazky_stravne.create', 'N');
         api_component.setEnable('tab-pj_stazky_stravne.edit', 'N');
         api_component.setEnable('tab-pj_stazky_stravne.delete', 'N');

         api_component.setenable('tab-pj_stazky_stravne.btn-vypocetStravne', 'N');
      END IF;

      -- km schvalene
      IF do_stavu = c_stav_stazky_KMS THEN
         api_sys.api_debug_log('stazky_RW_grid  do_stavu = c_stav_stazky_KMS');
         api_component.setEnable('tab-pj_stazky_jizdy.create', 'N');
         api_component.setEnable('tab-pj_stazky_jizdy.edit', 'N');
         api_component.setEnable('tab-pj_stazky_jizdy.delete', 'N');
         api_component.setEnable('tab-pj_stazky_objed.create', 'N');
         api_component.setEnable('tab-pj_stazky_objed.edit', 'N');
         api_component.setEnable('tab-pj_stazky_objed.delete', 'N');
         api_component.setEnable('tab-pj_stazky_stravne.create', 'Y');
         api_component.setEnable('tab-pj_stazky_stravne.edit', 'Y');
         api_component.setEnable('tab-pj_stazky_stravne.delete', 'Y');

         api_component.setenable('tab-pj_stazky_stravne.btn-vypocetStravne', 'Y');
      END IF;

      -- stravne vypocitane
      IF do_stavu = c_stav_stazky_SV THEN
         api_sys.api_debug_log('stazky_RW_grid  do_stavu = c_stav_stazky_SV');
         api_component.setEnable('tab-pj_stazky_jizdy.create', 'N');
         api_component.setEnable('tab-pj_stazky_jizdy.edit', 'N');
         api_component.setEnable('tab-pj_stazky_jizdy.delete', 'N');
         api_component.setEnable('tab-pj_stazky_objed.create', 'N');
         api_component.setEnable('tab-pj_stazky_objed.edit', 'N');
         api_component.setEnable('tab-pj_stazky_objed.delete', 'N');
         api_component.setEnable('tab-pj_stazky_stravne.create', 'N');
         api_component.setEnable('tab-pj_stazky_stravne.edit', 'N');
         api_component.setEnable('tab-pj_stazky_stravne.delete', 'N');

         api_component.setenable('tab-pj_stazky_stravne.btn-vypocetStravne', 'N');

      END IF;
      -- uzamknuta
      IF do_stavu = c_stav_stazky_UZ THEN
         api_sys.api_debug_log('stazky_RW_grid  do_stavu = c_stav_stazky_UZ');
         api_component.setEnable('tab-pj_stazky_jizdy.create', 'N');
         api_component.setEnable('tab-pj_stazky_jizdy.edit', 'N');
         api_component.setEnable('tab-pj_stazky_jizdy.delete', 'N');
         api_component.setEnable('tab-pj_stazky_objed.create', 'N');
         api_component.setEnable('tab-pj_stazky_objed.edit', 'N');
         api_component.setEnable('tab-pj_stazky_objed.delete', 'N');
         api_component.setEnable('tab-pj_stazky_stravne.create', 'N');
         api_component.setEnable('tab-pj_stazky_stravne.edit', 'N');
         api_component.setEnable('tab-pj_stazky_stravne.delete', 'N');

         api_component.setenable('tab-pj_stazky_stravne.btn-vypocetStravne', 'N');

      END IF;
      api_sys.api_debug_log('stazky_RW_grid.end l_stazka_id=' || l_stazka_id);
   END;

Debug output:

USER : 08-06-2015 21:23:42      stazky_RW_grid.start do_stavu=14658540
USER : 08-06-2015 21:23:42      stazky_RW_grid  l_stazka_id=25093299
USER : 08-06-2015 21:23:42      stazky_RW_grid  do_stavu = c_stav_stazky_KMS
USER : 08-06-2015 **21:23:49**      stazky_RW_grid.end l_stazka_id=25093299

asked 08 Jun '15, 15:47

Tomeo's gravatar image

Tomeo
162353
accept rate: 3%

edited 08 Jun '15, 16:26


link

answered 08 Jun '15, 17:13

Tomeo's gravatar image

Tomeo
162353
accept rate: 3%

Hi,

For debug disable code where executing query and try. I think is a problem :)

link

answered 09 Jun '15, 03:18

AlfAbetas's gravatar image

AlfAbetas
611417
accept rate: 9%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×1

Asked: 08 Jun '15, 15:47

Seen: 733 times

Last updated: 09 Jun '15, 03:18

Related questions


© Copyright Gerger 2017