ADO.NET for oracle不关闭连接 [英] ADO.NET for oracle doesn't close connections

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

问题描述

当使用ADO.NET for oracle从.NET应用程序连接到oracle服务器时,即使我关闭了连接,连接在Oracle服务器上仍然处于非活动状态,因为每个用户限制的会话无法建立新连接,有没有办法确保所有的连接都关闭?

When connecting to oracle server from .NET application using ADO.NET for oracle, even if i closed the connection, the connection remains inactive at the Oracle server, so new connections could not be established because of the sessions per user limitation, is there is any way to make sure that all connections are closed? from Oracle server or from .NET application.

提前感谢

推荐答案

p>由于这些连接可能会暂时打开一段时间连接池?你能粘贴一些代码显示如何关闭连接吗?

Could it be the connections stay open for a while due to connection pooling? Can you please paste some code showing how you close the connections? Also are you using ODP.NET or the Microsoft supplied classes?

您可以尝试关闭连接池(添加; Pooling = false 到ODP.NET中的连接字符串),以查看您的问题是否是由于使用它的结果而引起的(只需要注意,创建一个新的物理连接到DB是一个昂贵的操作,所以你可能实际上' t想永久关闭连接池)。

You could try turning connection pooling off (add ;Pooling=false to the connection string in ODP.NET) to see if your issue is caused as a consequence of using it (just be aware that creating a new physical connection to the DB is an expensive operation, so you probably actually don't want to turn off connection pooling permantly).

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

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