Command timeout doesn't work for prepared commands

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
bozr
Posts: 17
Joined: Mon 21 Jun 2010 12:39

Command timeout doesn't work for prepared commands

Post by bozr » Tue 06 Sep 2011 12:32

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

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 09 Sep 2011 17:51

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.

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Thu 22 Sep 2011 16:00

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.

Shalex
Site Admin
Posts: 8247
Joined: Thu 14 Aug 2008 12:44

Post by Shalex » Fri 30 Sep 2011 13:14

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 .

Post Reply