The easiest way to watch the actual SQL queries generated and troubleshoot, accordingly, is with log4net. Download log4net, add a reference to it within your project and then do the following...
Add the following to your app/web.config:
Code:
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections>
<!-- If you want to turn it off completely for all loggers, include 'threshold="OFF"' in the log4net tag immediately following this -->
<log4net>
<appender name="LogAllToFile" type="log4net.Appender.FileAppender">
<file value="whatever.log"/>
<appendToFile value="false"/>
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%d [%t] %-5l - %m%n%n"/>
</layout>
</appender>
<root>
<priority value="ALL"/>
<!-- ALL, DEBUG, INFO, WARN, ERROR, FATAL, OFF-->
<appender-ref ref="LogAllToFile"/>
</root>
</log4net>
</configuration>
And then in the Application_Start method of Global.asax...
Code:
// Initialize log4net
XmlConfigurator.Configure();
With this in place, whatever.log will be populated with all the actual SQL queries, along with a bunch of other stuff.
Alternatively, you can also mess around with Ayende@Rahien's NHibernate Query Analyzer found at
http://www.ayende.com/projects/nhiberna ... lyzer.aspx
Billy