While tuning Oracle ADF application in our team, we have discovered extremely good approach for application tuning on page load time. You can read about this problem in my previous blog post as well - Improving Performance in ADF Applications - Page Load Time in CRUD Forms.
Main idea of tuning approach is to prevent default query execution on page load and do it as easy as possible. We have achieved this by invoking executeEmptyRowSet() method for master View Object before opening page itself. We are performing invocation from Method Call activity in ADF Task Flow. Download sample application - ADFPageOpening.zip.
How it works: let's open our data entry page from main index page:

Data entry page opens in Insert mode. However, by default even page opens in Insert mode, framework still is sending default SQL query to database. If this query is complex and database performs many joins, it will take time to open your page. With this approach I'm describing today, no SQL query will be sent to database and page will open fast:

If user wants to edit data, ADF Query component should be used to filter data, only at that point SQL query will be sent to database:

How its implemented: ADF Task Flow contains Default Activity, this means it will be invoked each time when entering ADF Task Flow. This activity is Method Call:

This Method Call is invoking custom method implemented in Application Module implementation class - initPage() method:

Custom method implements call to executeEmptyRowSet() on master View Object and inserts new row. Method executeEmptyRowSet() prevents SQL query execution on page load by creating empty row set and in such way initializing iterator:

Spanish Summary:
En este artÃculo se explora una carateristica de ADF Business Componentes que permite evitar realizar consultas innecesarias a la base de datos mejorando la performance de las aplicaciones.
Main idea of tuning approach is to prevent default query execution on page load and do it as easy as possible. We have achieved this by invoking executeEmptyRowSet() method for master View Object before opening page itself. We are performing invocation from Method Call activity in ADF Task Flow. Download sample application - ADFPageOpening.zip.
How it works: let's open our data entry page from main index page:

Data entry page opens in Insert mode. However, by default even page opens in Insert mode, framework still is sending default SQL query to database. If this query is complex and database performs many joins, it will take time to open your page. With this approach I'm describing today, no SQL query will be sent to database and page will open fast:

If user wants to edit data, ADF Query component should be used to filter data, only at that point SQL query will be sent to database:

How its implemented: ADF Task Flow contains Default Activity, this means it will be invoked each time when entering ADF Task Flow. This activity is Method Call:

This Method Call is invoking custom method implemented in Application Module implementation class - initPage() method:

Custom method implements call to executeEmptyRowSet() on master View Object and inserts new row. Method executeEmptyRowSet() prevents SQL query execution on page load by creating empty row set and in such way initializing iterator:

Spanish Summary:
En este artÃculo se explora una carateristica de ADF Business Componentes que permite evitar realizar consultas innecesarias a la base de datos mejorando la performance de las aplicaciones.
2 comments:
Hi Andrejus,
I have a ViewObject Query table(select * from table) which loads by default on page load on my .jspx page.
My use case is display nothing 'no data to display' (on table) on page load ... like you're inserting a blank row (which is also fine) but ONLY display data when I do a "Search" (i.e click on a 'search' button )(I have a ViewCriteria query which performs the search)
I tried to apply your example on mine ...but all I could get to is i'm able to insert a blank row on page load (with your code) but after initial page load , I want to be able to display data after I perform a 'Search'
continuation of my previous comment ....also forgot to add this ....
if I delete whatever I typed in the 'search' input box , it should also NOT display any data again ...
thanks a lot.
Post a Comment