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
[EMAIL PROTECTED]
_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi
_______________________________________________
Delphi mailing list
[email protected]
http://ns3.123.co.nz/mailman/listinfo/delphi