-->
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: Custom statistics?
PostPosted: Thu Feb 11, 2010 12:25 am 
Newbie

Joined: Wed Feb 10, 2010 11:34 pm
Posts: 1
Location: Sydney
Hi all,

I am trying to customize/enhance the processing of the query statistics: In short I'd like to provide a concrete implementation of the StatisticsImplementor interface to Hibernate:

Code:
public interface StatisticsImplementor {
   ...
   public void queryExecuted(String hql, int rows, long time);
   ...
}

This is invoked by Loader as follows:
Code:
   
   /**
    * Actually execute a query, ignoring the query cache
    */
   protected List doList(final SessionImplementor session, final QueryParameters queryParameters)
         throws HibernateException {
                ...
      if ( stats ) {
         getFactory().getStatisticsImplementor().queryExecuted(
               getQueryIdentifier(),
               result.size(),
               System.currentTimeMillis() - startTime
            );
      }
                ...
        }

I have a class implementing Statistics and StatisticsImplementor in the same fashion as Hibernate's StatisticsImpl but
I could find no lead on the web, the forums, the documentation as to whether/how to get Hibernate to use it.

Having browsed through the code it all seem to derive from the implementor version of the session factory and the session.
It seems a tad involved to have to code new concrete implementations of SessionFactory/SessionFactoryImplementor, Session/SessionImplementor just for the purpose of overriding the getStatistics/getStatisticsImplementor. I tried wrapping Hibernate classes and got nowhere. Did I miss something?

Has anyone customized the statistics? Any suggestion?

Thanks for your help guys, I am stuck!


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.