Jopr today has the capability to manage/monitor Hibernate if its running inside Tomcat or JBossAS via its Hibernate plugin. It can even monitor more than one Hibernate application/JVM that is running on your machine, even if they are using different versions of Hibernate!
Today, I checked in code to the RHQ core and Jopr Hibernate plugin to have it also support Hibernate that is running in a standalone JVM (in fact, it can now support Hibernate running in any JVM, so long as it can remotely connect to the Hibernate Statistic MBean's MBeanServer).
This is such a cool feature, that I decided to "wink" it. Watch the flash demo to see how you can examine your Hibernate statistics in the Jopr GUI - things such as which queries were executed, how many times they were executed and how long it took to execute them; how many and which entities were created and deleted, etc. This is a very helpful set of features for developers - I can attest to that because I use this to examine the RHQ Server's own Hibernate usage.
There are a couple caveats:
First, the JVM that Hibernate is running in must have JMX remoting enabled and configured to accept connections from the agent. Google "com.sun.management.jmxremote" and read all about the settings used to configure this. The demo used something like this:
java -Dcom.sun.management.jmxremote.port=19988 \
Second, your application must have enabled the Hibernate Statistics MBean. This sounds obvious, but I guess I should explicitly mention it. If you don't tell Hibernate to turn on its statistics, you can't very well get any useful data from it. To do this, your application will have to execute something like this:
StatisticsService mBean = new StatisticsService();
SessionFactory sessionFactory = ...get hibernate session factory...
ObjectName objectName = new ObjectName("Hibernate:application=MY_APP_NAME,type=statistics");
MBeanServer mbs = ManagementFactory.getPlatformMBeanServer();
Once you place your statistics MBean in an MBeanServer that can be remotely accessed, your Jopr Hibernate plugin will do the rest.