-->
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.  [ 2 posts ] 
Author Message
 Post subject: QueryExecutionCount per Session
PostPosted: Tue Oct 21, 2008 9:50 am 
Newbie

Joined: Mon Oct 20, 2008 1:34 am
Posts: 6
I am looking for a way to get the amount of queries executed in a specific session.

I found one thread in this forum related to this:
http://forum.hibernate.org/viewtopic.ph ... utioncount
... but resetting the statistics as suggested there does not work in my case because there are multiple sessions open at the same time.

If there is no such option in Hibernate, where would be the best place to implement that? Maybe I have to use a proxy for JDBC connections used by hibernate?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 11, 2008 6:09 am 
Newbie

Joined: Mon Oct 20, 2008 1:34 am
Posts: 6
Because there has not been any reply on my question, I thought i should post my workaround. Although it is oracle specific, it is working fine in my scenario (i don't have to support other databases):

Code:
select * from v$mystat where statistic# = 342


the above statement will return the execute count for the current session. The oracle documentation describes it that way:

Quote:
The total number of calls (user and recursive) that execute SQL statements.
[/code]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.