Custom Type Qualified By Wrong Schema Does Not Error Out (Doc ID 2002549.1)

Last updated on MARCH 08, 2017

Applies to:

JDBC - Version 12.1.0.2.0 and later
Information in this document applies to any platform.

Goal

When using the JDBC driver 12.1.0.2, the driver does not complain about the user-defined type not found under the qualifying schema, but tries to find it via synonyms and query on all_synonyms is generated.

Consider the following example:
* USER1 creates a user-defined type DEMO_OBJECT and creates a public synonym for this type
* USER2 is granted execute privileges to this type

* A java program calls createDescriptor() for this type (the type is qualified with a schema where the object is not present; in this case SCOTT).
 
 



This results in the expensive query below being generated:


SELECT ELEM_TYPE_NAME, ELEM_TYPE_OWNER
FROM
ALL_COLL_TYPES WHERE OWNER = (SELECT DISTINCT TABLE_OWNER FROM ALL_SYNONYMS
WHERE SYNONYM_NAME=:1) AND TYPE_NAME = (SELECT DISTINCT TABLE_NAME FROM
ALL_SYNONYMS WHERE SYNONYM_NAME=:2)

 

Is this expected behavior?

Solution

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