子声波不关闭连接 [英] Sub Sonic not closing connections

查看:257
本文介绍了子声波不关闭连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用LINQ从亚音速3是这样的:

I'm using Linq from SubSonic 3 like this:

for(int x; x < 100; x++) {
   var v = (from c in db.categories
            where c.parent == 10
            select c);

   if (v.Count() > 0) return null;

   category[] c = v.ToArray();
}



由于某种原因亚音速不关闭连接...所以经过几次上面的循环我在泳池用完SQL连接或MySQL只是拒绝允许更多的连接的运行......我已经试过这都与SS 3.0.3和SVN,我不断收到这些错误。

for some reason SubSonic is not closing the connections...so after a few runs of the above loop I run out of SQL connections in the pool or MySQL just refuses to allow more connections...I've tried this both with SS 3.0.3 and with SVN, and I keep getting these errors.

我应该怎么做,收出连接后,我得到一组结果?

What should I be doing to close out the connections after I get a set of results?

感谢

推荐答案

问题 - 信不信由你 - 是不是亚音速。这是$ * $&放大器; $ MySQL驱动程序。我们明确地关闭掉,当你做这样的查询连接,但我见过的MySQL驱动程序完全忽略赞成一些封真的,在优化真的跛脚尝试。

The problem - believe it or not - isn't SubSonic. It's the $*$&$ MySQL driver. We explicitly close off the connection when you do queries like this, but I've seen the MySQL driver completely ignore the closure in favor of some really, really lame attempts at optimization.

我不知道该怎么在这里告诉你 - 我很抱歉地说。

I don't know what to tell you here - I'm very sorry to say.

这篇关于子声波不关闭连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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