provide pg_get_notifications()

Поиск
Список
Период
Сортировка
От maxxedit@gmail.com
Тема provide pg_get_notifications()
Дата
Msg-id CAOnzxq7h_oT3dyHTdj1H3fOiL7CJGM_gCTkuQ-gZha+aznWqbw@mail.gmail.com
обсуждение исходный текст
Список pgsql-general
Hi,

Please provide a pg_get_notifications() function (or similar) as a
complement to pg_notify().

Currently, in java jdbc, the clients must poll for notifications using
getNotifications() method in org.postgresql.PGConnection. So, clients
must obtain a reference to connection object and cast it down
(presumably from java.sql.Connection) to org.postgresql.PGConnection.

It is very problematic to not be able to use the connection as
java.sql.Connection. In a typical set-up, the connection must be
obtained from a ORM framework (like hibernate) which wraps the
underlying connection in its own dynamic proxy. The underling
connection to ORM itself may be wrapped up in another proxy by a
connection pool like commons.apache.org/pool . And if you want to be
fancy, the underlying connection to commons-pool may be wrapped in
another proxy by connection profilers like
log4jdbc/jdbmonitor/javamelody.

If the programmer knows the set-up, he can of course overcome the
problem by using framework-specific knowledge to obtain a PGConnection
(using a lot of downcasts) or reflection tricks (not desirable).
However, in some cases, the programmer cannot possibly know the set-up
in advance. For example if he writes a middleware/help library.


And thus the need for pg_get_notifications() function.

thanks,

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

Предыдущее
От: "Albe Laurenz"
Дата:
Сообщение: Re: Frontend/Backend protocol question.
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Ways to edit users and permissions for database