Page 1 of 1

Command timeout doesn't work for prepared commands

Posted: Tue 06 Sep 2011 12:32
by bozr
Hi,

Setting the command timeout to 0 to suppress timeout exceptions as indicated in the documentation doesn't seem to work for prepared commands. I'm using dotConnect version 5.30.202 in combination with PostgreSQL 8.4.8.

Code to reproduce:

Code: Select all

DbProviderFactory factory = DbProviderFactories.GetFactory(@"Devart.Data.PostgreSql");
DbConnection connection = factory.CreateConnection();
connection.ConnectionString = @"Host=localhost;Database=test;User Id=test;Unicode=true";
connection.Open();

DbCommand command = connection.CreateCommand();
command.CommandText = "worker_func";
command.CommandType = CommandType.StoredProcedure;
command.CommandTimeout = 0;
command.Prepare();

try
{
    command.ExecuteNonQuery();
}
catch (DbException e)
{
    Console.Error.WriteLine(e.Message);
}

connection.Close();
This always results in a PgSqlException "Server did not respond within the specified timeout interval" after 30 seconds, ignoring any value specified as CommandTimeout.

When the prepare statement is commented out, the value of CommandTimeout is used correctly.

Postgres function definition:

Code: Select all

CREATE OR REPLACE FUNCTION worker_func()
  RETURNS void AS $$
BEGIN
  WHILE TRUE LOOP
  END LOOP;
END;
$$ LANGUAGE plpgsql VOLATILE;
To me this seems like a bug?

Regards,
Ruud

Posted: Fri 09 Sep 2011 17:51
by Shalex
Thank you for your report. We have reproduced the mentioned behaviour with the 5.50.214 build of dotConnect for PostgreSQL. We will investigate it and notify you about the results.

Posted: Thu 22 Sep 2011 16:00
by Shalex
The bug with workability of command timeout for prepared commands is fixed. We will post here when the corresponding build of dotConnect for PostgreSQL is available for download.

Posted: Fri 30 Sep 2011 13:14
by Shalex
New build of dotConnect for PostgreSQL 5.50.228 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/postgr ... nload.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=22166 .