Saturday, February 15, 2014

Cache in Iterator binding

This post is about the "CACHE" attribute in Iterator bindings. Though it looks very simple to turn on/off cache in iterator it has lot of implications with respect to performance, so just wan't to highlight it with an example :-)

Employee-Department view link of HR schema is used here.

Step 1 - I have generated java class for EmployeeVO and Departments VO with custom data source methods, placed sysouts in executeQueryForCollection.

Step 2 -  Drag and drop the view link as master detail table, run the application and observe the sysouts-

Here department VO's query is executed once on page load and employee VO query is executed as we select each department. This sounds fair right? Let turn of the Cache in iterator and try again.

Step 3- Re run the app again and now you could able to notice that DepartmentsVO gets executed on page load and as well on every PPR. Look at the number of EmployeeVO queries for each PPR !!

Proves to be an important factor :-)

No comments:

Post a Comment