开发者

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

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

}


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜