vo.executeQuery() Executes Query Twice in the Database When View Object Created

(Doc ID 345144.1)

Last updated on AUGUST 05, 2016

Applies to:

Oracle JDeveloper - Version 9.0.5.2.0 to 11.1.1.2.0 [Release AS10g to Oracle11g]
Information in this document applies to any platform.
***Checked for relevance on 25-Feb-2013***

Symptoms

Your application is using dynamic View Objects created by the method createViewObjectFromQueryStmt()
You note performance problems when executing the method executeQuery() (or other method that in turn executes executeQuery() method, eg first(), ...)
Setting up the BC4J trace (-Djbo.debugoutput=console) indicates that the SQL is executed twice:

[250] (0) ViewObjectImpl.buildQuery(2101) select * from huge_table order by col1
...
[258] (10) ViewObjectImpl.buildQuery(2101) select * from huge_table order by col1

and your DBA can confirm that the query is executed twice in the database:

select executions, parse_calls
  from v$sql
 where sql_text = 'select * from huge_table order by col1'
/
EXECUTIONS PARSE_CALLS
---------- -----------
         2           2

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms