Error on opening DbConnection

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
hepek
Posts: 126
Joined: Thu 07 Jul 2011 13:59

Error on opening DbConnection

Post by hepek » Mon 25 Feb 2013 21:38

Receantly I got this error on PROD server.
Error on opening DbConnection, Server did not respond within the specified timeout interval

There was a problem with ORACLE connection, details included below. After that a lot of requests timed out and IIS CPU usage was 99%.
We had to restart IIS on a server. (Windows 2003 64 bit, oracle client 11g 32 bit)

I would expect this kind of error to raise exception before reuqest time out.
(currently Request Timeout is set to 2 minutes)

In another words, when any kind of ORACLE error happens my app should raise exception right away. In this case it took at least 2 minutes and finaly request timed out.

How can I be sure that Devart command/connection times out before IIS Response times out?

thanks

Code: Select all

Exception information: 
    Exception type: LinqCommandExecutionException 
    Exception message: Error on opening DbConnection.
   at Devart.Data.Linq.LinqCommandExecutionException.CanThrowLinqCommandExecutionException(String message, Exception e)
   at Devart.Data.Linq.Provider.k.a.g()
   at Devart.Data.Linq.Provider.k.a.b(IConnectionUser A_0)
   at Devart.Data.Linq.Provider.k.b(IConnectionUser A_0)
   at Devart.Data.Linq.Provider.DataProvider.ExecuteQuery(CompiledQuery compiledQuery, Object[] parentArgs, Object[] userArgs, Object lastResult)
   at Devart.Data.Linq.Provider.DataProvider.Devart.Data.Linq.Provider.IProvider.Execute(Expression query)
   at Devart.Data.Linq.DataQuery`1.System.Linq.IQueryProvider.Execute[S](Expression expression)
   at System.Linq.Queryable.SingleOrDefault[TSource](IQueryable`1 source)
   at RRD.OnePlace.BLL.JobBO.SaveUserFilter(Int64 empID, String filter)


.....

Server did not respond within the specified timeout interval
   at Devart.Data.Oracle.bd.a(ac A_0, ai A_1)
   at Devart.Data.Oracle.OracleInternalConnection..ctor(ac connectionOptions, OracleInternalConnection proxyConnection)
   at Devart.Data.Oracle.bx.a(j A_0, Object A_1, DbConnectionBase A_2)
   at Devart.Common.DbConnectionFactory.a(DbConnectionPool A_0, j A_1, DbConnectionBase A_2)
   at Devart.Common.DbConnectionPool.a(DbConnectionBase A_0)
   at Devart.Common.DbConnectionPool.GetObject(DbConnectionBase owningConnection)
   at Devart.Common.DbConnectionFactory.b(DbConnectionBase A_0)
   at Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
   at Devart.Common.DbConnectionBase.Open()
   at Devart.Data.Oracle.OracleConnection.Open()
   at Devart.Data.Linq.Provider.k.a.g()

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Error on opening DbConnection

Post by Shalex » Tue 26 Feb 2013 17:36

hepek wrote:Error on opening DbConnection, Server did not respond within the specified timeout interval
Please increase the value of the Connection Timeout connection string parameter.
hepek wrote:How can I be sure that Devart command/connection times out before IIS Response times out?
Please set the corresponding values in the Connection Timeout and Default Command Timeout connection string parameters. Setting the OracleCommand.CommandTimeout property explicitly overrides the value which is set via the Default Command Timeout connection string parameter.

hepek
Posts: 126
Joined: Thu 07 Jul 2011 13:59

Re: Error on opening DbConnection

Post by hepek » Tue 26 Feb 2013 17:44

how do I set Command Timeout in connection string?

thanks

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: Error on opening DbConnection

Post by Shalex » Wed 27 Feb 2013 12:27

OracleConnection conn = new OracleConnection("Default Command Timeout=60;");

If a command is created in any of the following ways, the cmd.CommandTimeout property will be set with the value which is specified in the Default Command Timeout connection string parameter:
1. OracleCommand cmd1 = conn.CreateCommand();
2. OracleCommand cmd2 = new OracleCommand("", conn);
3. OracleCommand cmd3 = new OracleCommand();
cmd3.Connection = conn;

Post Reply