Log that shows actual SQL query hibernate is executing?

Is there a log file that tells you the actual query hibernate is executing? We have a queryEntity that is behaving strangely and I want to run the same query on the DB to try to isolate the problem.

 

Thanks in advance!

Larson

  Discussion posts and replies are publicly visible

Parents
  • You might want to do this on the database side, depending on the database type and how busy it is. You can normally switch on SQL trace, which stores every query that is run in a table, but it's quite resource-intensive and so should only be switched on for short periods.

    For what it's worth, a single a!queryEntity is usually made up of two or more SQL queries. If you've got sql trace on, you can search the results by the name of the table the query is running against.

Reply
  • You might want to do this on the database side, depending on the database type and how busy it is. You can normally switch on SQL trace, which stores every query that is run in a table, but it's quite resource-intensive and so should only be switched on for short periods.

    For what it's worth, a single a!queryEntity is usually made up of two or more SQL queries. If you've got sql trace on, you can search the results by the name of the table the query is running against.

Children
No Data