Showing posts with label Caching. Show all posts
Showing posts with label Caching. Show all posts

Tuesday, June 24, 2014

ADF: Optimize Read-Only Queries (for caching)

Consider you have a list of items which you show to the user regularly, be it in a table or a listOfValues or even for processing. With default setting of the view object you would have to fire as many queries as you have in database ( Duh ! )

So the default settings look like this:




With the above settings it will fetch "All the rows" in batches of 1 ( "As Needed" ). This largely affects the table scrolling as queries gets fired "As Needed" in batches of 1.

For caching purposes we should have "All Rows" queried "All at Once" - this will ensure we get all results into our view with just one query. Be careful though with the number of records you have in table - you might land up in "OutOfMemory" exception :)





Note: You might also want to play around with "in batches of" parameter to regulate the number of queries fired.

Sunday, June 22, 2014

Oracle Webcenter: Caching with read-only viewobjects


What are the read-only view objects used for?

– One of the most used trick to have up your sleeve when dealing with read only objects is to be able to cache it on view layer. 
– Avoid read only view objects for speed benefits alone - Older ADF manualsrecommended using read only view objects as there was a minor speed benefit. Since JDeveloper 11g thisis no longer true as the caching mechanism has been improved. Today read only view objects should bereserved for complex queries such as those with set operations (e.g. UNION, MINUS, INTERSECT)and connect by queries. All other view objects should be based on entity objects.


Being said that, we can use the in memory mode of retrieving the data for rows in af:table by using a large fetchSize.