|
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
|