I got trunk version of NH and FNH. When i try to add 2nd level cache, some parts of NHibernate forgets about chosen sqldialect.
Initial configuration:
I had a similar issue (removing SetMaxResults
also helped but I needed paging) and found out that the following NHibernate configuration property was causing this bug:
true
It's certainly a bug, because the GetAfterSelectInsertPoint
method doesn't take into account that SQL comments may be prepended to the SQL query.
Just set the use_sql_comments
property to false
and the problem disappears.