Re: using the same connection?

From: ncm(at)zembu(dot)com (Nathan Myers)
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: using the same connection?
Date: 2001-02-06 19:04:06
Message-ID: 20010206110406.O624@store.zembu.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 06, 2001 at 11:08:49AM -0500, Mathieu Dube wrote:
> Hi y'all,
> Is it a bad idea for an app to keep just a couple of connections to a
> database, put semaphore/mutex on them and reuse them all through the program?
> Of course I would check if their PQstatus isnt at CONNECTION_BAD and
> reconnect if they were...

You would have to hold the lock from BEGIN until COMMIT.
Otherwise, connection re-use is normal.

Nathan Myers
ncm(at)zembu(dot)com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Lamar Owen 2001-02-06 19:09:06 Re: Include files for SPI are not installed
Previous Message Karel Zak 2001-02-06 19:03:42 Re: 25 March 2001 bug