Query timeout

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for PostgreSQL
Post Reply
jorgesv13
Posts: 7
Joined: Thu 09 Oct 2008 00:54

Query timeout

Post by jorgesv13 » Sat 02 Aug 2014 01:21

Hello
I am using Devart.Data.PostgreSql 4.55.49.0 and I'm having a problem when executing a large query.
This query takes about 15 minutes to run (when executing it on pgAdmin)
However, when I execute it in my application, after a couple of minutes I get an error like "Can't write data on transport connection. There was an error because the connected part did not answer after a period of time". It looks like it comes from the Socket.Receive function.
The full stack trace and error (in spanish) is this:

Code: Select all

Devart.Data.PostgreSql.PgSqlException: No se puede escribir datos de en la conexión de transporte: Se produjo un error durante el intento de conexión ya que la parte conectada no respondió adecuadamente tras un periodo de tiempo, o bien se produjo un error en la conexión establecida ya que el host conectado no ha podido responder. ---> System.IO.IOException: No se puede escribir datos de en la conexión de transporte: Se produjo un error durante el intento de conexión ya que la parte conectada no respondió adecuadamente tras un periodo de tiempo, o bien se produjo un error en la conexión establecida ya que el host conectado no ha podido responder. ---> System.Net.Sockets.SocketException: Se produjo un error durante el intento de conexión ya que la parte conectada no respondió adecuadamente tras un periodo de tiempo, o bien se produjo un error en la conexión establecida ya que el host conectado no ha podido responder 
   en System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) 
   en System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) 
   --- Fin del seguimiento de la pila de la excepción interna --- 
   en System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) 
   en Devart.Common.af.a(Byte[] A_0, Int32 A_1, Int32 A_2) 
   en Devart.Common.j.c(Byte[] A_0, Int32 A_1, Int32 A_2) 
   en Devart.Common.q.e(Byte[] A_0, Int32 A_1, Int32 A_2) 
   --- Fin del seguimiento de la pila de la excepción interna --- 
   en Devart.Data.PostgreSql.PgSqlDataReader.e(Int32 A_0) 
   en Devart.Data.PostgreSql.PgSqlCommand.InternalExecute(CommandBehavior behavior, IDisposable stmt, Int32 startRecord, Int32 maxRecords) 
   en Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior) 
   en System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior) 
   en System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) 
   en System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) 
   en System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) 
I think, I need to somehow increase the timeout of this socket function. How can I make it?

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Query timeout

Post by Pinturiccio » Mon 04 Aug 2014 14:14

Try to assign a greater value to the PgSqlCommand.CommandTimeout property (by default it equals 30 seconds) or set it to 0. For more information, please refer to http://www.devart.com/dotconnect/postgr ... meout.html

Post Reply