[DUG] Firebird connections / queries

Kyley Harris KyleyHarris at gmail.com
Wed Jul 27 16:03:18 NZST 2005


I also use firebird/interbase.

Yes. I think it is fine to leave queries in a prepared state. If you did 
not.... well there would be no point preparing them. The whole concept
is to have it cached and ready to go so that its fast.

I write n-tier software, so the client talks to my middleman, who talks 
to the server. Generally I cache my connection and would never have
more than 10 connections to serve up to 50-60 clients. The never turn 
off. They will sit there and run for weeks on end (years hopefully)
if there is an error with the connection, then I reset it. otherwise its 
the same thing with it being slower and unprepared. The only real useful 
Advantage I can see would be to free up my connection pool after a 
pre-defined idle period (ie 1 hour) but it doesn't really help or hinder 
the server.

If you are writing a 2 tier application where there will be unknown 
number of connections and and then each connection has lots and lots of 
queries. ie 30 client * 20-100 queries then I would say that you are 
probably flogging the poor horse and yes, free up your connections when 
not needed.

Paul Lowman wrote:

>Hi all
>
>I am using Firebird / dbExpress in an industrial control application and
>wondered about the following points:
>
>Is it OK to open a connection to a database and leave it open for extended
>periods (ie: days) or should I open and close the connection on demand?
>
>Similarly is it OK to prepare queries when the app starts and leave them in
>a prepared state for extended periods?
>
>My instincts tell me that this may be a bad approach ...
>
>Any opinions welcome ...
>
>Cheers
>
>Regards
>
>Paul Lowman
>
>paul_lowman at xtra.co.nz
>
>_______________________________________________
>Delphi mailing list
>Delphi at ns3.123.co.nz
>http://ns3.123.co.nz/mailman/listinfo/delphi
>
>  
>


More information about the Delphi mailing list