-->
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: Profiling sql sent to the db via BasicExecutor.execute()
PostPosted: Thu May 21, 2009 6:07 am 
Newbie

Joined: Mon Jan 26, 2009 6:14 am
Posts: 3
Hi,

I'd like to start profiling all the SQL statements being sent via hibernate to the database, basically to get a total execution + transport time for every db call.

I've played around with the Interceptor and EventListener interfaces and I can capture most statements via flushEvents or postFlush()/preFlush() interception, but I can't seem to find a way to intercept arbitrary hql or native sql statements that go through BasicExecutor.execute(). e.g. something like:

Code:
Query update = session.createQuery("update MyEntity m set m.myField = 'newValue' where m.id = :idToUpdate");
update.setString("idToUpdate", id);
update.executeUpdate();


I can only intercept the transaction start/end and the prepare statement but not the actual flush.

Does anyone know if it's possible to do this with hibernate EventListerners/Interceptors or is Hibernate maybe the wrong place to implement this level of profiling? If it's the latter does anyone have any recommendations for profiling tools?

Thanks,
Stephen


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.