NHibernate没有显示启用ShowSql的更新查询 [英] NHibernate not showing Update queries with ShowSql enabled

查看:136
本文介绍了NHibernate没有显示启用ShowSql的更新查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是NHibernate 3.1的Visual Studio 2010,并使用Fluent NHibernate进行映射。它一直运行良好,并启用ShowSql它显示所有选择查询。

我已经到了程序的一部分,我正在执行一些更新,但他们不显示。起初我以为更新没有被触发,即使我正在使用一个明确的事务 - 但数据库中的数据正在改变。所以 - 不知何故,查询正在执行,但没有显示在Visual Studio的输出窗口。



有什么想法?



编辑
事实证明,我正在把两个答案混合在一起。 Log4Net在输出窗口中根本不需要NHibernate的UPDATE语句。



设置 AdoNetBatchSize(0)与ShowSQL DID 一起解决问题。

解决方案

我可以建议你给 NHibernate Profiler 一试。我已经使用了它在过去的一年左右,它已被证明是非常宝贵的。它会以非常有用的方式向您显示所有的疑问。您可以使用30天的试用来解决您的问题。




  • 免责声明:我与Hibernating Rhinos或Ayende没有任何关系一个开心的顾客。


I am using Visual Studio 2010 with NHibernate 3.1 and using Fluent NHibernate for mapping. It has been working well, and with the ShowSql enabled it shows all the select queries.

I have gotten to the portion of the program where I am performing some updates, but they don't show. At first I thought the updates weren't getting triggered even though i was using an explicit transaction - but the data was getting changed in the database. So - somehow, the queries are being executed, but not shown in the Output window of Visual Studio.

Any ideas?

Edit It turns out I was mixing two answers together. Log4Net is not needed at all to produce UPDATE statements from NHibernate in the output window.

Setting AdoNetBatchSize(0) in conjunction with ShowSQL DID resolve the problem.

解决方案

May I suggest you give NHibernate Profiler a try. I've been using it for the last year or so and it has proved invaluable. It will show you all the queries in a very useful way. You could just use the 30 day trial to solve your problem.

  • Disclaimer: I am in no way affiliated with Hibernating Rhinos or Ayende, just a happy customer.

这篇关于NHibernate没有显示启用ShowSql的更新查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆