Problem running large scripts with PgSqlScript component

Problem running large scripts with PgSqlScript component

Postby 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"
Source="CoreLab.Data"
ErrorCode=-2147467259
LineNumber=0
Position=0
StackTrace:
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.
hmuscroft
 
Posts: 23
Joined: Tue 28 Nov 2006 10:07

Postby Alexey.mdr » Wed 16 Jan 2008 14:30

We are investigating this problem.
I'll let you know our progress.
Alexey.mdr
 
Posts: 729
Joined: Thu 13 Dec 2007 10:24

Postby 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;
        cmd.ExecuteNonQuery();
      }

instead of
Code: Select all
pgSqlScript.Execute()

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;
SecureGen
Devart Team
 
Posts: 133
Joined: Thu 08 Sep 2005 06:27

Postby 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.
aspirevishal
 
Posts: 30
Joined: Fri 31 Aug 2007 03:30
Location: India


Return to dotConnect for PostgreSQL