What effect does destroying database related threads have on system resources?

From: Frank Church <voipfc(at)gmail(dot)com>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: What effect does destroying database related threads have on system resources?
Date: 2012-02-25 08:28:26
Message-ID: CALgpEGexKP9Xvumnc_oaxFvCdx+YntazT=SNFsWsaENPRQimkw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

An application I have written connects to a remote Postgresql 8.3/8.4
database using Lazarus/FreePascal components, Zeoslib, but it has been
timing out too often as the network gets busy in a bursty mode. When the
network times out, restarting the app retrieves the data quickly, it is
always available in good time. The problem with some of the busier networks
is that timeout dialogs happen too often and it annoys the users who have
to restart the app.

My approach then is to run the database for displaying locally (which is
actually the original design) and fetch the data from the remote database
in background thread or in a background helper utility and insert it into
the local database, where the timeouts do not occur.

This creates 2 problems

1. When the connection times out

2. When the query itself times out.

Since handling connection timeouts and query timeouts can be fraught,what I
want to do is to create the whole process of retrieving the data in a
thread within the main program or in a helper utility, and destroying the
thread if it times out, but I can't be sure of what happens to the
resources created by the thread when it is destroyed, both in the program
code itself, the libpq libraries and on the server.

What are the consequences of working this way with lipql and the server?

Any ideas on what is likely to happen?

/voipfcGuy

Browse pgsql-general by date

  From Date Subject
Next Message Jasen Betts 2012-02-25 09:07:55 Re: Behavior of subselects in target lists and order by
Previous Message Naoko Reeves 2012-02-25 07:34:10 Re: invalid memory alloc request size 1765277700 Error Question