Re: [cx-oracle-users] Query Result Change Notification
Brought to you by:
atuining
From: Glen W. <gl...@wa...> - 2012-11-24 03:59:24
|
On 24/11/12 3:56 AM, Yann Cézard wrote: > Le 23/11/2012 09:09, Yann Cézard a écrit : >> Le 23/11/2012 03:43, Glen Walker a écrit : >>> >>> [...] >>> Hi, >>> >>> I've submitted a pull request with my changes to support query >>> result set change notification. You can find it on Bitbucket >>> <https://bitbucket.org/anthony_tuininga/cx_oracle/pull-request/2/> >>> if you don't want to wait. Sample code below. >>> >>> Kind regards, >>> Glen >>> >> Thanks a lot, Glen. >> I'll do some tests as soon as possible (this afternoon if I can) and >> I will give my feedback. >> >> Regards, > Ok, so I did try a similar example as yours, I just updated the query > to my use case, > and it works ! but only one time... :-) > I mean, the first change in the database that modifies the query > result set is well > sent to my client. But than, any other change that affects the query > result set isn't > notified anymore. If I close the client, and restart it, the first > change is notified and > then nothing. > > It's as if the server deregistered my subscription after the first > notification. > > If I look at the USER_CHANGE_NOTIFICATION_REGS table, after the client > is launched, > the query is there. After the first notification, it isn't anymore. > > And as a matter of fact, in the USER_CHANGE_NOTIFICATION_REGS table, > REGFLAGS is > 6 (if rowids is enabled) or 2 (if rowids is disabled) in QRCN mode, > and it's 0 (rowids disabled) > or 4 (rowids enabled) in OCN mode (which doesn't have this behaviour). > So it looks like : > QOS_DEREG_NFY BINARY_INTEGER 2 Purge registration on first > notification > is enabled by default ? > (http://docs.oracle.com/cd/B28359_01/appdev.111/b28424/adfns_cqn.htm#autoId21) > > Is it a wanted behaviour ? Am I the only one to have this behaviour by > default ? > And is there a way to disable it ? (I didn't find any mention of > QOS_DEREG_NFY > in the code... I'll try to look further !). > > Thanks for your work anyway, it is so close to what I was expecting ! > > Regards, > -- > Yann Cézard - administrateur systèmes serveurs > Centre de ressources informatiques -http://cri.univ-pau.fr > Université de Pau et des pays de l'Adour -http://www.univ-pau.fr Hi Yann, In the example code I used qos=cx_Oracle.SUBSCR_QOS_PURGE_ON_NTFN in the call to connection.subscribe. This was intended to demonstrate use of the option, but in your case you don't want this behaviour. If you remove the qos argument from the call to connection.subscribe you should continue to receive notifications until you unsubscribe. Regards, Glen |