Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ORACLE TIMEOUTS - how can i set a longer timeout using this connection string?

Tags:

oracle

i am using this connection string in .net to connect to oracle and keep timing out getting a large result set.

how can i 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)));";

}
like image 957
kacalapy Avatar asked Dec 15 '10 19:12

kacalapy


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;";

More info on Oracle Data Provider for .NET / ODP.NET

like image 78
Conrad Frix Avatar answered Nov 15 '22 07:11

Conrad Frix


are you looking for a connection timeout on the connection string?

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. (http://www.connectionstrings.com/oracle)

or are you looking for the CommandTimeout on the command item?

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

I think for a long running query you will need to extend the CommandTimeout property... however it defaults to 0 (no limit) so you may want to check that

like image 21
Harrison Avatar answered Nov 15 '22 08:11

Harrison