Re: Another exception (Transaction level)

Поиск
Список
Период
Сортировка
От Csaba Nagy
Тема Re: Another exception (Transaction level)
Дата
Msg-id 1059143024.10668.24.camel@coppola.ecircle.de
обсуждение исходный текст
Ответ на Re: Another exception (Transaction level)  (Ole Streicher <ole-usenet-spam@gmx.net>)
Список pgsql-jdbc
>  > Concurrently? Do you mean that you a sharing one connection between
>  > several threads?
>
> Yes. I didn't see a hint why this should be problematic.

You should use a connection pool: open a few connections beforehand, and
each thread can then request one for it's exclusive use, and then give
it back after finishing. There are lots of possible
strategies/variations you could apply to the nr. of initial connections,
how to grow/shrink that depending on load, what happens if there are too
many connections open and there's a new connection (you can wait or
throw exception), etc.
Google around or search this list for "connection pool" and I'm sure
you'll find a lot of hints and code examples.

Cheers,
Csaba.



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

Предыдущее
От: Ole Streicher
Дата:
Сообщение: Re: Another exception (Transaction level)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Another LargeObject problem