[jboss-user] [EJB 3.0] - How to get Query time??

ablevine1 do-not-reply at jboss.com
Wed Feb 7 18:54:55 EST 2007

I'm trying to write some code to evaluate query performance in my ejb3 code. I was wondering if there was some way to get the actual time that it takes jboss to load/store /update stuff in the database.  Doint this following will NOT work:

  | long t1 = System.currentTimeMillis();
  | em.merge(myEJB);
  | long updateTime = System.currentTimeMillis() - t1;

This does not work because if this is happening in a transaction the actually storing of the stuff is not done until the end of the transaction, so measuring the time it takes em.merge to complete is not a valid estimate of the actual update time.

Is there any way to tap into some low level jboss API or use interceptors to get a more accurate measure of the database update time??

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4012717#4012717

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4012717

More information about the jboss-user mailing list