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.  [ 1 post ] 
Author Message
 Post subject: how to count all queries per session
PostPosted: Mon Aug 17, 2009 1:15 pm 
Newbie

Joined: Mon Aug 17, 2009 12:54 pm
Posts: 2
Hi,

I would like to count all queries per session. Do You know any solutions how to achieve that.

I have just tried Interceptor with overridding the method onPrepareStatement, however this approach isn' t
perfect, just because hibernate has a pool with Prepared Statement, and doesn't call that method twice for the same sql statement. If You know possibility to disable that pool, maybe it would help me.

class MyInteceptor extends EmptyInterceptor {
private long countQueries;
public String onPrepareStatement(String sql) {
countQueries++;
return sql;
}
}


Or Hibernate fire any event when it exetuces sql statements?

Thanks for help
Michal


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

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.