Oracle ADF: Lifecycle method calls taking long time when ViewCriteria execute "in memory" mode
<p>I have a ViewCriteria "findByID1" created on a ViewObject "myVO". The mode for execution of this view criteria has been set "in memory".
Whenever I am programatically applying the view criteria and executing, the calls on all the methods of ViewObject ( hasNext, getRowCount, next etc), it is taking invariably long time. I have checked multiple times and confirmed that the actual query with the where clause is not taking long time to fetch the results It is further suggested by the fact that sometimes, the ViewObject doesnt return any records, still the method calls take very long.
can anyone please suggest what might be a possible reason for this behaviour.</p>

<p>Code snippet below: </p>

<pre><code>ViewCriteria vcInMemory =
  this.getVO1().getViewCriteria("inMemoryViewCrit");
this.getVO1().applyViewCriteria(vcInMemory );
this.getVO1().setNamedWhereClauseParam("pTimeDefinitionId",
                                                 this.getParentVO().getCurrentRow().getAttribute("TimeDefinitionId"));
this.getVO1().executeQuery();
// this.getVO1().getRowCount();     // tried executing this lifecycle method. This is also taking very long time(~180 seconds). Even if in a lot of cases, it doesnt return any records (i.e 0 for this method)
if (this.getVO1().hasNext()) {      // method call taking long time : ~ 180 seconds.

  while (this.getTimePeriod3().hasNext()) {
    this.getTimePeriod3().next();
    this.getTimePeriod3().removeCurrentRow();
  }
</code></pre>