ORACLE TIMEOTS - how can I set a longer timeout using this connection string?

I use this connection string in .net to connect to the oracle and save the time of getting a large set of results.

How to set a longer connection timeout using this connection string?

static private string GetOracleConnectionString() { return "User Id=USER;Password=pass;Data Source=(DESCRIPTION=" + "(ADDRESS=(PROTOCOL=TCP)(HOST=14.12.7.20)(PORT=1139))" + "(CONNECT_DATA=(SID=QCTRP1)));"; } 
+4
source share
2 answers
 return "User Id=USER;Password=pass;Data Source=(DESCRIPTION=" + "(ADDRESS=(PROTOCOL=TCP)(HOST=14.12.7.20)(PORT=1139))" + "(CONNECT_DATA=(SID=QCTRP1)));Connection Timeout=60;"; 

Learn more about Oracle Data Provider for .NET / ODP.NET

+7
source

Are you looking for connection timeout in the connection string?

When the connection is closed, the pooling service determines whether the connection has exceeded the connection value of the Lifetime attribute. If so, the connection is closed; otherwise, the connection returns to the pool connection. (Http://www.connectionstrings.com/oracle)

or are you looking for CommandTimeout in a command element?

 Specifies the number of seconds the command is allowed to execute before terminating the execution with an exception 

I think that for a long query you need to extend the CommandTimeout property ... however, by default it is 0 (no limit), so you can check that

+3
source

Source: https://habr.com/ru/post/1332253/


All Articles