What is difference between Oracle session and Orac

2019-08-21 02:43发布

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.

2条回答
可以哭但决不认输i
2楼-- · 2019-08-21 03:09

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.

查看更多
3楼-- · 2019-08-21 03:24

You need to explicitly close the connection using Close() or use a using block to ensure the unmanaged code is garbage collected properly.

查看更多
登录 后发表回答