First connection to the database (Oracle) from a .Net console application takes 6 sec

S

Sunil Menon

Dear All,
I am using Oracle Client 8.1.7.0.0.
My .Net (c#) console application makes a connection to Oracle database
and has following code

Console.WriteLine(DateTime.Now.ToString());

OracleConnection NDPConnection = new OracleConnection("User
ID=<Username>;Data Source=O801;Password=<Password>;");
NDPConnection.Open();

Console.WriteLine(DateTime.Now.ToString());

NDPConnection.Close();
It is observed that the Open method takes almost 6 sec the first time
it is executed. Next all instances of the application opens the
connection very fast. Next time again when the code is executed after
restarting the machine, opening the connection takes almost 6 sec.
Is there something to improve this? Have I missed something? Please
help.

Thanks & regards
Sunil
 
G

Guest

Sunil,

After the first connection, the subsequent connections are probably coming
from the connection pool. That's the benefit of connection pooling.

Kerry Moorman
 
S

Sunil Menon

Connection Pooling is destroyed once I close my exe...
After I restart my exe the connection to the database is still
faster...how come?
Is this something related to network?

Thanks & regards
Sunil
 

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