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

Home -> Community -> Usenet -> c.d.o.server -> Re: Detecting events in oracle. Transmitting them to java client

Re: Detecting events in oracle. Transmitting them to java client

From: Jim Kennedy <kennedy-family_at_attbi.com>
Date: Sun, 27 Oct 2002 15:48:22 GMT
Message-ID: <aVTu9.133509$La5.431659@rwcrnsc52.ops.asp.att.net>


Simpler, although not a good scalable solution would be to , ugh, poll.

The client finds out about the alert thusly:

Main program does it's stuff

1. It spawns a thread to take care of receiving the alert.
2. This thread log onto the db.
3. Thread registers interest in whatever alerts it is interested in. It is a
sql call.
4. Thread uses the dbms_alert.waitany procedure to wait for the alert. (since this is a blocking call this is why you have it in a thread; otherwise it would stop your main program.) Probably have it wait x amount of time and if no raised alert then wait again. 5. When an alert is received (it is received the same way that selects from the database happen.) the thread notifies the main program. I can think of a couple of possibilities, but you probably know more Java than I do. I would be interested in how you do this conceptually in Java. Jim

"Simon Harvey" <ReplyToGroup_at_thanks.com> wrote in message news:%gOu9.999$ly6.69560_at_stones...
> Hi Jim,
>
> Thanks for that answer, that is perfect! These newsgroups are such a good
> resource for discovering ideas and creating new ones! Thanks to everyone
for
> making it such a good resource.
>
> I'll definately be looking into alerts then!!
>
> If anyone could tell me about or point me in the right direction
concerning
> the "Simpler" possibility that Jim mentioned, that would be great. I'm
just
> getting started so simple is fine for me at this stage. I do like Jims
idea
> though and will definately be aiming to get onto that stage asap.
>
> One question i did have and would be really grateful if someone could help
> with is that i understand a client will be notified when an alert goes off
> in the database. But how does the message get from server to clients? How
do
> I get a client to register its interest in oracle alerts? Is it done via
> sockets? What else should I be looking into?
>
> Thanks all
>
> Take care
>
> Simon
>
>
Received on Sun Oct 27 2002 - 09:48:22 CST

Original text of this message

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