Showing posts with label Dictionary. Show all posts
Showing posts with label Dictionary. Show all posts

Wednesday, 30 January 2013

Dynamic Action hidden False actions

I thought I'd share what's quite literally a hidden problem I experienced in 4.1.1 involving dynamic actions.

The project used hundreds of dynamic actions, and often I would copy them between pages.

Something to watch out for, however, is the cleaning up APEX does with dynamic actions in it's own builder. I've notice in the past the meta-data I saw in dictionary views contained stale information, hidden after no longer being needed when adjusting some other attribute - like condition types.

By looking at the stock debug, I noticed that a good portion of my page render time was for dynamic action plug-ins. One of these was for the notification plug-in supplied by Oracle (gritter). Over time the number of notifications on the Global Page Zero had grown - but in my case could be consolidated using &ITEM. substitution syntax to define the title & message.

But there were still more instance of the gritter notification in the rendered page sauce than was expected, so I looked a little harder...

In regard to dynamic actions, beware the non-condition - in past I must have copied this from another action; removed the event "when" condition; the false action region was hidden from the developer, but and a false action remained - causing unnecessary rendering of a plug-in, hence performance issue. What a paragraph, hope that made sense!

All I saw when editing the item were the True actions.
True actions for DA with no JavaScript "when" event condition
By changing the when condition to "equal to", I was able to see the previously hidden False action.
screenshot actually from 4.2
Sure enough - there it is
A hidden False action, displayed when condition restored
So I had a few false actions to remove that would never fire.

You can find such cases yourself with the following SQL - I used this query to check for other issues.
select * 
from   apex_application_page_da d
-- no when condition present
where when_condition is null 
--and dynamic_action_name = ''
and application_id = 104
and page_id = 0
and exists  -- a false condition
  (select null 
   from apex_application_page_da_acts a
   where a.dynamic_action_id = d.dynamic_action_id
   and dynamic_action_event_result = 'False')
/

I saved about .05 seconds each plug-in render, so notifications in page zero added up over time. I saved about third of a second in my clean up of these alone. Plus I was finding other minor performance gains - they all add up!

Scott

Wednesday, 23 January 2013

Which pages are locked in APEX?

Would you some SQL to tell you which pages are locked?

As far as I could tell, there is no data dictionary view that this information.

So I found this using the all_tab_columns view
SELECT 
  id
 ,flow_id
 ,object_id
 ,locked_by
 ,locked_on
 ,lock_comment
 ,security_group_id
FROM apex_040200.wwv_flow_lock_page
WHERE 1=1
--AND   flow_id   = :APP_ID 
--AND   object_id = :APP_PAGE_ID
/
I used it to add a region (bound to a build option) that displayed a notification in the sidebar to other developers that the page was locked and under construction/change/development.

Scott.

ps - can you find the joke on this post?