-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: What is this query for? ...SELECT NULL AS table_cat...
PostPosted: Tue Jan 18, 2011 3:53 pm 
Beginner
Beginner

Joined: Mon May 10, 2010 2:00 pm
Posts: 22
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.


Top
 Profile  
 
 Post subject: Re: What is this query for? ...SELECT NULL AS table_cat...
PostPosted: Wed Jan 19, 2011 3:02 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
Seems like a query to retrieve metadata about the tables in your database. As far as I know Hibernate is only interested in this at startup time (eg. when creating a SessionFactory). It is nothing that should be seen during normal operations.


Top
 Profile  
 
 Post subject: Re: What is this query for? ...SELECT NULL AS table_cat...
PostPosted: Wed Jan 19, 2011 11:40 am 
Beginner
Beginner

Joined: Mon May 10, 2010 2:00 pm
Posts: 22
nordborg wrote:
Seems like a query to retrieve metadata about the tables in your database. As far as I know Hibernate is only interested in this at startup time (eg. when creating a SessionFactory). It is nothing that should be seen during normal operations.


That's what we assumed as well. However, we are seeing this query come across multiple times after the application has been started.

Maybe it has something to do with the C3PO connection pooling?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.