SCM

[#1011302] Setting CommandTimeout too high gets silently ignored

View Trackers | Bugs | Download .csv | Monitor

Date:
2013-02-07 18:51
Priority:
3
State:
Open
Submitted by:
Jelmer Baas (jelmer)
Assigned to:
Nobody (None)
Npgsql Version:
2.0.11
Category:
None
Group:
None
Resolution:
None
Summary:
Setting CommandTimeout too high gets silently ignored

Detailed description
I'm still struggling with timeout errors while using npgsql, even when setting the timeout values to absurdly high values.

For example:
pConn = new NpgsqlConnection(Server=192.168.0.26;Port=5432;Database=xxx;User ID=xxx;Password=xxx;CommandTimeout=3600000);
NpgsqlCommand pCmd = new NpgsqlCommand("very long query", pConn);
pCmd.CommandTimeout = 99999999;
pCmd.ExecuteNonQuery();

Yet, after 4m 30s, I get an "Npgsql.NpgsqlException":
A timeout has occured. If you were establishing a connection, increase Timeout value in ConnectionString. If you were executing a command, increase the CommandTimeout value in ConnectionString or in your NpgsqlCommand object. Timeout:99999999
at Npgsql.NpgsqlState.ProcessBackendResponsesEnum(NpgsqlConnector context) in C:\Data\npgsql\Npgsql2.0.11.93.src\src\Npgsql\NpgsqlState.cs:line 389
at Npgsql.NpgsqlReadyState.QueryEnum(NpgsqlConnector context, NpgsqlCommand command) in C:\Data\npgsql\Npgsql2.0.11.93.src\src\Npgsql\NpgsqlReadyState.cs:line 67
at Npgsql.NpgsqlConnector.QueryEnum(NpgsqlCommand queryCommand) in C:\Data\npgsql\Npgsql2.0.11.93.src\src\Npgsql\NpgsqlConnector.cs:line 301
at Npgsql.NpgsqlCommand.GetReader(CommandBehavior cb) in C:\Data\npgsql\Npgsql2.0.11.93.src\src\Npgsql\NpgsqlCommand.cs:line 609
at Npgsql.NpgsqlCommand.ExecuteNonQuery() in C:\Data\npgsql\Npgsql2.0.11.93.src\src\Npgsql\NpgsqlCommand.cs:line 512
at [my code]


On a related note: I believe a NpgsqlCommand object always uses its default timeout value unless you manually set it otherwise. This means that having the Connection object with a timeout of 3600, but a newly created Command object still cancels after a short time.

Followup

No Followups Have Been Posted

Attached Files:

Changes:

No Changes Have Been Made to This Item

Powered By FusionForge