Oracle 会话和 Oracle 连接有什么区别或者两者是相同的..?

发布于 2024-11-02 10:20:39 字数 700 浏览 11 评论 0原文

我正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

世俗缘 2024-11-09 10:20:39

这里的信息太少,无法给出答案。我们需要了解有关您的连接代码的更多信息。你用的是什么版本的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.

絕版丫頭 2024-11-09 10:20:39

您需要使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文