Oracle connection

G

Guest

Hello

I've got a problem about Oracle connection. If I stop the database (with sqlplus) and I try an Oracle connection with .NET without restarting the .NET application, the status is still "Open" despite the database is closed. I need to restart the .NET application to have a connection refused (which is the true behaviour)

Here is the VB.NET code

Imports System.Data.OracleClien
....
strConnString = "Data Source=test;User ID=test;password=test
m_Connection = New OracleConnection(strConnString
m_Connection.Open(
...
m_Connection.Close(

I hope someone can help me with this problem
Best regards. Cedri
 
M

Mohamoss

hi Cedric
you might be enabling connection pooling .So a connection is left in your
pool open and it is returned back to you when you try to create new one of
course you see its status as opened ,, try to check for that
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 
G

Guest

Hi Mohamoss

Thanks for your help. It works well now. I add "pooling=false" in the connection string and now the database status is correct

Best regards Cedric
 
M

Mohamoss

Great.... but you note that you have to do that for every connection string
you have in your code. You can have more that one pool. One is created for
every signature of the connection string

best regards
Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top