I'm having trouble with an ObjectNotFoundException
where Hibernate appears to be performing a select
statement where I didn't expect it too, due to lazy loading being true. I suspect something to do with AOP, but I can't change anything since I'm using someone else's framework.
I was thinking of putting a breakpoint in the place where the select statement gets generated into my log, that way I can see who's triggering it. What's the Hibernate class I should be setting breakpoints on?
I believe that the log entry is generated within org.hibernate.jdbc.util.SQLStatementLogger
Hell is other people's frameworks. You can see Hibernate logging its SQL if you configure log4j to get debug-level logging for org.hibernate.SQL and trace-level logging for org.hibernate.type. But Hibernate's SQL generation happens a long way from where it decides what it needs to do, so I doubt that will help. The SessionImpl has an ActionQueue that lists the actions Hibernate will take, you may want to watch what gets shown there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With