An application I have written connects to a remote Postgresql 8.3/8.4 database using Zeoslib components, 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. This may not be the best place for knowing what happens in the library or on the server, but in the LCL and FPC will destroying the thread destroy all the resources it creates? Any ideas on what is likely to happen? PS. I may not have posted here for some time due to critical work pressues, but I have been lurking. I hope I have been missed ;) PS2. I will be posting to the forums as well -- Frank Church ======================= http://devblog.brahmancreations.com
-- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus