Thursday, April 7, 2016

ADF BC View Criteria Query Execution Mode = Both

View Criteria is set to execute in Database mode by default. There is option to change execution mode to Both. This would execute query and fetch results from database and from memory.  Such query execution is useful, when we want to include newly created (but not commited yet) row into View Criteria result. Newly created row will be included into View Criteria resultset.

Download sample application - JobsView in sample application is set with query execution mode for View Criteria to Both:

I'm using JobsView in EmployeesView through View Accessor. If data from another VO is required, you can fetch it through View Accessor. View Accessor is configured with View Criteria, this means it will be automatically filtered (we only need to set Bind Variable value):

Employees VO contains custom method, where View Accessor is referenced. I'm creating new row and executing query with bind variable (primary key for newly created row). View Criteria is set to execution mode Both, this allows to retrieve newly created row (not commited yet) after search:

View Criteria execution mode Both is useful, when we want to search without loosing newly created rows.

1 comment:

Usman Khalid said...

Hy Andrejus!
I am seeking for help on a scenario not related to this Blog though
I am creating an application and I have configure security that authenticate a user and directs him to home page successfully. Now In my DB I have data about two different locations which I refer as segments i.e segment 1 and 2... Now my requirement is that when user logged in and provide his/her segment that will be either 1 or 2, only data about that segment should appear on screen. Is there anyway to achieve this functionality? Any help please?
Advance Thanks :)