Non-closed queries : influence on the server ?
Posted in 1998
Topics: SQL Development & Query Writing
(Same question also on borland.public.delphi.database.sqlservers) I have to write a report about a Delphi-program that communicates with an Informix SE server. The Delphi program runs on 60 clients win95. Informix SE runs on a Compaq Pentium biProcessor, Unix SCO. The Delphi-C/S-program can be quick and can be slow. The slowest queries are joins of 9,10,11 tables : max 800 rows, max 2 kbyte/row (size 1.5 Mb). In a stand-alone version it's always quick. For this test I did adapt the program to work on a local Interbase 4.2. At this moment some one does examine the server and the network. I have notice that on one Client-PC 30 queries are still open while only 6 should be open. (I did use tool MEMPROOF http://www.nidlink.com/~astoyanov/downloads.htm.) In the Delphi source I find local variables that are created but never destroyed. Sometimes this variable is a query and the programmer didn't close the query. (I know that a query.free would have closed the query). Example Procedure TFRM_Werknemers.Load_Rights Var Q:TQuery; Begin Q:=TQuery.Create(Self); Q.Databasename:='DB'; Q.SQL.Add('select name from electrodienst '); Q.Open; While not Q.Eof do Begin Slb_geen.Items.Add(Q.Fieldbyname('name').AsString); Q.Next; End; End; Questions. ---------- 1. What can I say about the influence of non-closed queries on the server ? 2. When the client program is stopped, the database connection is closed, are all the remaining queries closed ? 3. Every friday the server has a back-up, a shutdown and a start. Do other people also shutdown and start their server at the end of the week ? Greetings, Jef Charlier