NHibernate 2nd lvl cache, custom query, sqldialect

前端 未结 7 1064
遥遥无期
遥遥无期 2020-12-21 06:59

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:

7条回答
  •  [愿得一人]
    2020-12-21 07:45

    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.

提交回复
热议问题