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.