We are refactoring the persistence level of a Java application from a JDBC template to JPA / Hibernate.
I profile the SQL statements issued to the database, and I see that "SHOW WARNINGS" is issued many, many times. According to JProfiler, "SHOW WARNINGS" makes up a significant portion of "integral time."
What can cause a frequent SHOW WARNINGS warning?
This SHOW WARNINGS was not previously released using the Jdbc template.
Below is the portion of our stack related to persistence. The only change here is the introduction of JPA / Hibernate.
- JPA / Hibernate: 4.3.6
- MySQL driver: 5.1.33
- MySQL Database: 5.6.20
- JDBC Connection Pool: HikariCP-2.3.2
EDIT: This gives an approximate stack trace when SHOW WARNINGS appears.
com.mysql.jdbc.StatementImpl.getWarnings() com.zaxxer.hikari.proxy.PreparedStatementJavassistProxy.getWarnings() org.hibernate.jpa.internal.QueryImpl.getSingleResult() com.mysema.query.jpa.impl.AbstractJPAQuery.getSingleResult(javax.persistence.Query) com.mysema.query.jpa.impl.AbstractJPAQuery.uniqueResult() com.mysema.query.jpa.impl.AbstractJPAQuery.uniqueResult(com.mysema.query.types.Expression) org.springframework.aop.framework.JdkDynamicAopProxy.invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[ ]) com.sun.proxy.$Proxy115.findOne(com.mysema.query.types.Predicate)
source share