On Wed, 26 Jun 2002 21:42:55 +0100 Rory Campbell-Lange <[EMAIL PROTECTED]> wrote:

> I have a script which I imagine will loop every 15 to 60 seconds.
> 
> Should I make the database connection at the beginning of the script,
> and just keep reusing it, or would it be more prudent to remake the
> connection in the body of the loop?
> 
> I'm connecting to postgresql on localhost (Linux).

Much more efficient to keep the connection.  You will want to be sure to
check for failures caused by losing the connection and either quit or
recover somehow.

-- 
Mac :})
** I normally forward private questions to the appropriate mail list. **
Ask Smarter: http://www.tuxedo.org/~esr/faqs/smart-questions.html
Give a hobbit a fish and he eats fish for a day.
Give a hobbit a ring and he eats fish for an age.


Reply via email to