Bug receiving NotificationResponse Message v3

Поиск
Список
Период
Сортировка
Искать
От
Hans Näther
Тема
Bug receiving NotificationResponse Message v3
Дата
Msg-id
401791A8.1090808@charite.de
Список
Дерево обсуждения
Bug receiving NotificationResponse Message v3 Hans Näther <Hans.Naether@charite.de>
Re: Bug receiving NotificationResponse Message v3 Kris Jurka <books@ejurka.com>
Re: Bug receiving NotificationResponse Message v3 Kris Jurka <books@ejurka.com>
Hello,

I found a problem in the current jdbc driver. My application receives 
asynchronous notification messages from the backend. Using postgresql 
7.1, it works. When I switch to postgresql 7.4, it doesn't work anymore. 
An exception postgresql.con.type is thrown in 
org.postgresql.core.QueryExecutor.executeV3. This is because 7.1 uses 
protocol version 2 and 7.4 uses protocol version 3. In version 3, the 
message format has changed, the message contains additional data 
(message length, additional information) => see 
http://www.postgresql.org/docs/current/interactive/protocol-message-formats.html 
under NotificationResponse.

So the function executeV3 needs to be changed, I propose the following 
change:

... (line 129):
switch (c)
{
   case 'A': // Asynchronous Notify
     int msglen = pgStream.ReceiveInteger(4); // added
     int pid = pgStream.ReceiveInteger(4);
     String msg = pgStream.ReceiveString(connection.getEncoding());
     String param = pgStream.ReceiveString(connection.getEncoding()); // 
added
     connection.addNotification(new 
org.postgresql.core.Notification(msg, pid));
     break;
case 'B':	// Binary Data Transfer
...


regards
Hans
В списке pgsql-jdbc по дате отправления
От: Kris Jurka
Дата:
Сообщение: Re: connectivity problem
От: Bhushan Bhangale
Дата:
Сообщение: Re: jdbc connection string
FAQ