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();
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;
Regards,
Ruud