executedirect timeout

Forum related to PostgreSQL

Moderators: gto, cipto_kh, EgonHugeist, olehs

Fresh Boarder
Fresh Boarder
Posts: 1
Joined: 11.09.2010, 18:52

executedirect timeout

Postby garynorton » 11.09.2010, 19:16

I am rewriting a cashregister POS program that was originally written in C++ into Lazarus
Everything working well with exception of handling network failures to a remote Postgres database.

If the network goes down while trying to connect to the ZConnection an exception occurs correctly after the preset timeout.

If the connection opens correctly then the network plug is pulled prior to performing a Zconection.executedirect('update table set .....) statement then the program hangs and never returns even after network is reestablished.

It seems the network connection timeout does not function when performing an executedirect.

Any help would be appreciated.

User avatar
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium

Postby mdaems » 19.09.2010, 21:31

Did you try setting timeout=<n> in the TZConnection properties?
In case you didn't :
postgres documentation wrote:connect_timeout
Maximum wait for connection, in seconds (write as a decimal integer string). Zero or not specified means wait indefinitely. It is not recommended to use a timeout of less than 2 seconds.

However, I don't know if this has an effect on an already existing connection. Some postgres gurus around that know more about this issue?


Expert Boarder
Expert Boarder
Posts: 162
Joined: 18.03.2008, 13:03

Postby Wild_Pointer » 20.09.2010, 07:48

Hello garynorton,

I've investigated the ExecuteDirect implementation for postgres and it seems to me the behavior of ExecuteDirect and TZQuery.Open should be the same. I guess you encounter the old problem of lost connection that led to Access violation usualy. It was resolved in v7 of Zeos (SVN Rev 789). Please try installing latest zeos from the svn repository and test if the problem still exists.

Hope it helps. Good luck!

Return to “PostgreSQL”

Who is online

Users browsing this forum: No registered users and 1 guest