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

  • Thread starter Thread starter Sunil Menon
  • Start date Start date
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
 
Sunil,

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

Kerry Moorman
 
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
 
Back
Top