Which class in Hibernate generates SQL queries that are logged?

I'm having problems with an ObjectNotFoundException , where Hibernate seems to be executing a select statement, which I didn’t expect this too, due to lazy loading. I suspect something is related to AOP, but I can’t change anything since I am using someone’s framework.

I was thinking about setting a breakpoint at the point where the select statement is being generated in my log, so I can see who runs it. What Hibernate class should I set breakpoints on?

+7
source share
3 answers

I believe the log entry is generated in org.hibernate.jdbc.util.SQLStatementLogger

+4
source

Hell is the framework of other people. You can see that Hibernate is logging its SQL if you configure log4j to get the debug level log for org.hibernate.SQL and the trace log for org.hibernate.type. But Hibernate SQL generation goes far from where it decides what it needs to do, so I doubt it helps. SessionImpl has an ActionQueue, which lists the actions that will be performed by Hibernate, you can see what is displayed there.

+3
source

Prior to the Hibernate 3.6.x line, the 3.6.x class was: org.hibernate.jdbc.util.SqlStatementLogger .

Starting at line 4.x , at least up to class 5.2 : org.hibernate.engine.jdbc.spi.SqlStatementLogger

+2
source

All Articles