We are experiencing issues with session blocking in our production environment. It appears that this query is executed by Hibernate, but I am having problems understanding when it executes and for what purpose. It is a process-intensive query that takes around 5+ seconds to return results.
Code:
SELECT NULL AS table_cat, o.owner AS table_schem, o.object_name AS table_name, o.object_type AS table_type, NULL AS remarks
FROM all_objects o
WHERE o.owner LIKE :1 ESCAPE '/' AND o.object_name LIKE :2 ESCAPE '/' AND o.object_type IN ('xxx', 'TABLE') ORDER BY table_type, table_schem, table_name
Since the query is using bind variables, I cannot determine the exact query results. However, I run this using wildcards ('%') and this is how I am basing my assumptions.
Here is the query with the wildcards:
Code:
SELECT NULL AS table_cat, o.owner AS table_schem, o.object_name AS table_name, o.object_type AS table_type, NULL AS remarks
FROM all_objects o
WHERE o.owner LIKE '%' ESCAPE '/' AND o.object_name LIKE '%' ESCAPE '/' AND o.object_type IN ('xxx', 'TABLE') ORDER BY table_type, table_schem, table_name
I am running Hibernate 2.5 against Oracle 11G using Tomcat 6, IIS 7.5, and Windows Server 2008 R2.
My questions:
What criteria must be met for Hibernate to execute this query?
What is the purpose of this query?
Any help with this is greatly appreciated.