Re: max connections

Поиск
Список
Период
Сортировка
От Rene Pijlman
Тема Re: max connections
Дата
Msg-id 7jq1pt8gquito8q8hpo1jur313vua61j7s@4ax.com
обсуждение исходный текст
Ответ на max connections  ("Simon Stanlake" <stanlake@hi.ca>)
Список pgsql-jdbc
On Wed, 29 Aug 2001 14:38:21 -0700, you wrote:
>My question is... what is the proper way to handle postgres connections in
>a multithreaded environment?

See
http://www.postgresql.org/users-lounge/docs/7.1/programmer/jdbc-thread.html

>is it OK to create a singleton of the connection?

"If a thread attempts to use the connection while another one is
using it, it will wait until the other thread has finished its
current operation. ...
This is fine for applications and applets but can cause a
performance problem with servlets. With servlets you can have a
heavy load on the connection. If you have several threads
performing queries then each but one will pause, which may not
be what you are after."

>if so, is there a way to limit the number of connections the
>pool makes to the database so that the maximum is not exceeded?

I'm not sure what you mean by that. If you create a singleton
I'd say there is exactly one connection.

Regards,
René Pijlman <rene@lab.applinet.nl>

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Rene Pijlman
Дата:
Сообщение: Re: ? (question mark) characters
Следующее
От: Rene Pijlman
Дата:
Сообщение: Re: Re: Proposal to fix Statement.executeBatch()