Make delicious recipes!

Debugging Hibernate

Following two options become really useful when debugging what queries are being generated by Hibernate:
<property name="show_sql">true</property>
<property name="format_sql">true</property>

However, sometimes you even want to debug why Hibernate is generating queries which seem redundant or less performant.
For such cases, it is helpful to debug the source code of Hibernate itself.
And this can be done by putting a breakpoint at
// package org.hibernate.engine.jdbc.spi

Putting a breakpoint on the above makes it very easy to see the place from where the query is being generated actually and can be a boon in debugging.
Additionally, If you think something is really wrong with Hibernate, you can even submit a patch request to Hibernate!

Like us on Facebook to remain in touch
with the latest in technology and tutorials!

Got a thought to share or found a
bug in the code?
We'd love to hear from you:

Email: (Your email is not shared with anybody)

Facebook comments:

Site Owner: Sachin Goyal