Hi. Is there a way to monitor the round-trips to the database in an NHibernate application? I need just a log to see when NHibernate connects to database.
+6
A:
Have a look at NHibernate Profiler (NHProf) if you don't mind a commercial product. Some of its features are:
- Visual insight into the interaction between your database and application code.
- Analysis and detection of common pitfalls when using NHibernate.
- Analysis is delivered via perfectly styled SQL and linkable code execution.
- Supports NHibernate (.NET) and Hibernate (Java).
M4N
2009-10-17 12:25:29
+2
A:
In addition to NHProf and log4net, there is also a "show_sql" config entry that will dump the SQL to the console in a console app.
Your database vendor should also have tools for monitoring the SQL that is being run against it.
Michael Maddox
2009-10-18 10:13:33