Reputation: 49
We are currently using the Oracle Data Connect dll in one of our VB .Net application that is configured as a Windows Service. The .Net Version we are using is Framework 3.5 and we connect to Oracle 10g.
This application constantly makes connectivity to Database and closes every connection immediately in that specific instance (A kind of singleton design pattern is involved in database connectivity). We were getting an error more frequently with respect to the DB connectivity (“CONNECTION LOST CONTACT”). After reading through some blogs, we added a parameter in the connection string as VALIDATE CONNECTION=TRUE. This error got resolved, but we are getting a new error message now , “Connection request timed out”
Upvotes: 0
Views: 2982
Reputation: 13303
The only connectionstring option I see that specifies a timeout using the Oracle Data Provider for .NET / ODP.NET is the following:
Data Source=myOracle;User Id=myUsername;Password=myPassword;Min Pool Size=10;Connection Lifetime=120;Connection Timeout=60;Incr Pool Size=5;Decr Pool Size=2;
You can get more examples here: http://www.connectionstrings.com/oracle#p12
Here is the description:
By default, connection pooling is enabled. This one controls the pooling mechanisms. The connection pooling service creates connection pools by using the ConnectionString property to uniquely identify a pool.
The first connection opened creates the connection pool. The service initially creates the number of connections defined by the Min Pool Size parameter.
The Incr Pool Size attribute defines the number of new connections to be created by the connection pooling service when more connections are needed.
When a connection is closed, the connection pooling service determines whether the connection lifetime has exceeded the value of the Connection Lifetime attribute. If so, the connection is closed; otherwise, the connection goes back to the connection pool.
The connection pooling service closes unused connections every 3 minutes. The Decr Pool Size attribute specifies the maximum number of connections that can be closed every 3 minutes.
Additionally, you can see if you are getting a timeout from the OracleCommand running your queries. Look for documentation on the OracleCommand.CommandTimeout Property.
Have a look on this site for a discussion on the oracle command Timeout https://forums.oracle.com/forums/thread.jspa?threadID=317603
Upvotes: 1