Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: AQ - no subscriber -> Errormsg

Re: AQ - no subscriber -> Errormsg

From: Viktor Achter <Viktor.Achter_at_post.com>
Date: Thu, 20 Dec 2001 20:11:27 +0100
Message-ID: <pod42u8sa0gquuctrsogg26bq0e1fv8qhh@4ax.com>


I solved my problem by catching the Oracle-Exception and do 'nothing'. Like:

create or replace procedure FireMessage(SIGTYPp IN Varchar2, INFOp IN Varchar2)
AS
begin
declare
enqueue_opts dbms_aq.enqueue_options_t;

m_p           dbms_aq.message_properties_t;
nachricht     ig1.message_type;
msg_h         raw(16);

begin
nachricht:=ig1.message_type(sigart => SIGTYPp, info => INFOp); m_p.expiration:=600;
enqueue_opts.visibility:=dbms_aq.immediate;

dbms_aq.enqueue(

queue_name                => 'ig1.message_queue',
enqueue_options           => enqueue_opts,
message_properties        => m_p,
payload                   => nachricht,
msgid            => msg_h);

exception when others then
null;

end;
end;
/

Thanks,
Viktor

On Thu, 20 Dec 2001 09:04:25 +0100, Viktor Achter <Viktor.Achter_at_post.com> wrote:

>Hi!
>
>I am using the Oracle Advanced Queues (AQ) to syncronize data of all
>clients, so that changes appear on every Client immediatly.
>Therefore I wrote a Procedure, that gets triggered by database change
>and uses the dbms_aq.enqueue Methode to enqueue every change, so that
>all subscribed clients can update apprppiatly. To accomplish this
>ont-to-many messaging, all clients subscribe to the queue, when they
>startup, and unsubscribe, when the shutdown.
>I don't give the equeue-procedure a receipientlist, so that the
>subscriptionlist is used.
>
>My problem is, that if no clients have subscribed to the queue, the
>enqueue-proc. returns with an error, because there are no subscribers.
>This makes the trigger and all databasechanges invalid.
>This happens, when someone is changing data in the dbms without using
>the client - for example while administrating the database.
>
>Deaktivating the triggers for this is a little anoying....
>I was thinking about catching the errormessage within the procedure
>which uses the enqueue-Method and tell it to do 'nothing' instead of
>throwing the error, but I wasn't able to find out how...
>
>Can anybody help me?
>
>Thanks!
>
>Viktor
Received on Thu Dec 20 2001 - 13:11:27 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US