Re: [JDBC] Could pgsql jdbc support pool reauthentication?

Поиск
Список
Период
Сортировка
От Vladimir Sitnikov
Тема Re: [JDBC] Could pgsql jdbc support pool reauthentication?
Дата
Msg-id CAB=Je-F1rFGM+-DFHgGWdBxQ_R3=Ptqf9iUyEBndE3pDiYGyaA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [JDBC] Could pgsql jdbc support pool reauthentication?  (Achilleas Mantzios <achill@matrix.gatewaynet.com>)
Ответы Re: [JDBC] Could pgsql jdbc support pool reauthentication?  (Achilleas Mantzios <achill@matrix.gatewaynet.com>)
Список pgsql-jdbc
Achilleas>I know, but we still risk having our max_connections exceeded.

You should limit the work at thread pool level, not at connection pool level.
That is you should not accept new tasks for execution if they might block on a "getConnection" call.

Imagine a case:
1) Thread A starts a transaction, it calls the DB
2) Thread B starts processing another request, it locks some Java lock and calls .getConnection. Unfortunately, there's not enough connections, sot it just waits.
3) Thread A completes the DB call, it continues and tries to take the same Java lock.

Now we have a deadlock: A is waiting for the Java lock and it holds a DB connection (with uncommitted transaction), while B is holding a Java lock and it is trying to get a connection.

That is, it is not connection pool's task to limit the number of concurrent requests.

Achilleas>And this is not scaleable.

Can you elaborate?

Vladimir

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

Предыдущее
От: Achilleas Mantzios
Дата:
Сообщение: Re: [JDBC] Could pgsql jdbc support pool reauthentication?
Следующее
От: Achilleas Mantzios
Дата:
Сообщение: Re: [JDBC] Could pgsql jdbc support pool reauthentication?