Hi. I'm just starting to use JavaMelody with a JPA application.
(I'm using Java 7, JPA, Hibernate as the JPA provider, C3P0 pooling, MySQL, Tomcat.)
The existing database configuration is specified thus:
javax.persistence.jdbc.url=jdbc:mysql://...
javax.persistence.jdbc.user=...
javax.persistence.jdbc.driver=com.mysql.jdbc.Driver
javax.persistence.jdbc.password=...
hibernate.c3p0.testConnectionOnCheckout=true
hibernate.connection.isolation=2
I configured JPA monitoring as per the instructions, by adding
the "provider" element to the "persistence-unit" element in persistence.xml:
<persistence version="2.1" xmlns="
http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="..." transaction-type="RESOURCE_LOCAL">
<provider>net.bull.javamelody.JpaPersistence</provider>
<class>...</class>
</persistence-unit>
</persistence>
There is no _other_ database configuration (e.g., JNDI, Spring, Hibernate).
The JPA statistics _do_ appear correctly, in the "Statistics jpa" section.
For example, the different requests are listed, with the number of hits, etc.
My question: There is also a "Statistics sql" section displayed, but
it is empty (it says "None"). _Should_ it be empty?
Richard.