Oracle 会话和 Oracle 连接有什么区别或者两者是相同的..?
我正在使用 Enterprise lib 连接 Oracle 数据库
class Customer{
private readonly Database _db;
public Customer(){
_db = = DatabaseFactory.CreateDatabase(_userSettings.ConnstringName);
}
.. stuff to use this connection..
}
当我运行应用程序并打开多个屏幕时,Oracle 显示多个会话 对于同一个应用程序
,我还尝试更改代码,因为
class Customer{
private readonly Database _db;
public Customer(){
_db = = (_userSettings.GetInstance().GetDatabase);
}
.. stuff to use this connection..
}
*_userSettings 是一个单例对象*
但同样的事情发生了..?
出了什么问题?
请帮忙,
谢谢。
I m using the Enterprise lib to connect Oracle Database
class Customer{
private readonly Database _db;
public Customer(){
_db = = DatabaseFactory.CreateDatabase(_userSettings.ConnstringName);
}
.. stuff to use this connection..
}
When I run the application and opens multiple screen now Oracle show multiple session
for same Application
Also I tried by changing code as
class Customer{
private readonly Database _db;
public Customer(){
_db = = (_userSettings.GetInstance().GetDatabase);
}
.. stuff to use this connection..
}
*_userSettings is a singleton object*
But same thing happens..?
What's going wrong?
Pls Help
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这里的信息太少,无法给出答案。我们需要了解有关您的连接代码的更多信息。你用的是什么版本的oracle?
可能发生的情况是,您可能没有为用户会话设置超时,以便您不断进行的这些会话保持活动状态。
There is too little information here to give an answer. We'd need to see more about your connection code. What version of oracle are you using?
What may be happening, is you may not be setting a timeout on your user's session, so that these sessions you keep making are staying active.
您需要使用 Close() 显式关闭连接或使用 using 块来确保正确收集非托管代码。
You need to explicitly close the connection using Close() or use a using block to ensure the unmanaged code is garbage collected properly.