problem with notify/listen

problem with notify/listen

Post by Bruce Momji » Sat, 26 Jan 2002 11:03:55



I assume this item is still open.  I put it in the 7.3 queue:

        http://candle.pha.pa.us/cgi-bin/pgpatches2

---------------------------------------------------------------------------


> I have just been looking into a bug report against the jdbc driver and I
> found the following behavior that I can't explain.

> If I run jdbc with setAutoCommit=true then notifications work as
> expected, however if I run with setAutoCommit=false then notifications
> are not being sent from the backend to the client.

> With autoCommit=false the jdbc driver is sending the following SQL
> commands to the server:

> begin
> select 1
> commit;begin;
> select 1
> commit;begin;
> select 1
> ...

> My test code is using the select statement as a means to poll for the
> notifications.  The only thing that is unusual about this is that the
> "commit;begin;" command string is sent to the server as a single query
> to be processed.

> With autoCommit=true the SQL commands are simply:

> select 1
> select 1
> select 1
> ...

> In this mode the notifications work correctly.

> Is there something I am doing wrong, or is this expected behavior for
> the server?

> thanks,
> --Barry

> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command


--
  Bruce Momjian                        |  http://candle.pha.pa.us

  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command

 
 
 

problem with notify/listen

Post by Barry Li » Sat, 26 Jan 2002 15:43:25


Yes this is still an open item.  I have already created a patch to jdbc
for the problem and am waiting for a 7.3 tree to apply it, as I am
uncomfortable with the changes going into 7.2 at this late date.

thanks,
--Barry


> I assume this item is still open.  I put it in the 7.3 queue:

>    http://candle.pha.pa.us/cgi-bin/pgpatches2

> ---------------------------------------------------------------------------


>>I have just been looking into a bug report against the jdbc driver and I
>>found the following behavior that I can't explain.

>>If I run jdbc with setAutoCommit=true then notifications work as
>>expected, however if I run with setAutoCommit=false then notifications
>>are not being sent from the backend to the client.

>>With autoCommit=false the jdbc driver is sending the following SQL
>>commands to the server:

>>begin
>>select 1
>>commit;begin;
>>select 1
>>commit;begin;
>>select 1
>>...

>>My test code is using the select statement as a means to poll for the
>>notifications.  The only thing that is unusual about this is that the
>>"commit;begin;" command string is sent to the server as a single query
>>to be processed.

>>With autoCommit=true the SQL commands are simply:

>>select 1
>>select 1
>>select 1
>>...

>>In this mode the notifications work correctly.

>>Is there something I am doing wrong, or is this expected behavior for
>>the server?

>>thanks,
>>--Barry

>>---------------------------(end of broadcast)---------------------------
>>TIP 2: you can get off all lists at once with the unregister command


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

 
 
 

1. LISTEN/NOTIFY

Ah, I'd forgotten about that.  Did it get accepted into DBD::Pg?

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

2. Taste that important update from M$

3. listen/notify argument (old topic revisited)

4. Bug(s)?

5. LISTEN/NOTIFY

6. Help with SQL Command

7. LISTEN/NOTIFY benchmarks?

8. Access 97 MDB with DAO 3.6?

9. NOTIFY/LISTEN Using Embedded SQL (ecpg)

10. listen/notify argument (old topic revisited)

11. Synchronous LISTEN/NOTIFY?

12. LISTEN/NOTIFY benchmarks?

13. DBD::Pg and NOTIFY (was Re: [GENERAL] Synchronous LISTEN/NOTIFY?)