Problem running large scripts with PgSqlScript component

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
Posts: 23
Joined: Tue 28 Nov 2006 10:07

Problem running large scripts with PgSqlScript component

Post by hmuscroft » Wed 16 Jan 2008 10:48

I have written a conversion utility to convert a database from DBISAM to PGSQL and am using your provider in my C# application.

The conversion works for about 80% of my customers databases, but for some customers who have very large databases, the sometimes throws the following exception :-
CoreLab.PostgreSql.PgSqlException was unhandled by user code
Message="A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"
at CoreLab.Common.DbScript.ExecuteNext(IDataReader& reader)
at CoreLab.Common.DbScript.Execute()
at co2005_to_v4.frmMain.ExecPGSQL(String sql) in E:\vs2005\source\co2005_to_v4\co2005_to_v4\frmMain.cs:line 253
The inner exception reports a "System.Net.Sockets.SocketError.TimedOut" error with error code 10060.

After a lot of testing, the problem seems to occur after a particularly long script (i.e. > 1 minute).

Is there any workaround for this, or perhaps a timeout value that I can tweak somewhere to make this work? Thanks.

Posts: 729
Joined: Thu 13 Dec 2007 10:24

Post by Alexey.mdr » Wed 16 Jan 2008 14:30

We are investigating this problem.
I'll let you know our progress.

Devart Team
Posts: 133
Joined: Thu 08 Sep 2005 06:27

Post by SecureGen » Wed 30 Jan 2008 12:20

Please test execution of this script with the following code:

Code: Select all

      foreach (SqlStatement stmt in pgSqlScript.Statements) {
        PgSqlCommand cmd = new PgSqlCommand(stmt.Text, connection);
        cmd.CommandTimeout = 60;
instead of

Code: Select all

If the script is successfully executed in this way, we will be able to support it in the Execute() method.
If the code still does not work, try increasing the value of ConnectionTimeout property:

connection.ConnectionTimeout = 60;

Posts: 30
Joined: Fri 31 Aug 2007 03:30
Location: India

Post by aspirevishal » Sat 02 Feb 2008 11:59

Hi hmuscroft

wanted to know if suggestions from SecureGen worked as I am also facing the same problem . I have a sql query that usually runs for more than 1 minute.

Post Reply