简体   繁体   中英

Implementing Oracle DCN with Coherence Cache in a weblogic application Server

I m trying to implements a DCN ( Database change notification ) on oracle to notify a listener of an event of DB so I can update Coherence Cache.

I followed the tutorial here and it is working fine using a sample program with a main method to execute the listener class and keep it running.

My question is how would this notification and listener gets implemented on a production environment since my local test was only running a main method to keep the listener running? what technology to use to keep the listener always running on the background and receive the notification from the database )?

We are using Weblogic 10 as our app server.

EDIT :

would a weblogic startup class work for this purpose?

The listener is run for you by the JDBC driver on a new thread (see the explanation here: http://docs.oracle.com/cd/E14072_01/java.112/e10589/dbchgnf.htm ). As it says, assuming you're using the pure JDBC approach:

"The JDBC driver launches a new thread that listens to notifications from the server (through a dedicated channel) and converts these notification messages into Java events. The driver then notifies all the listeners registered with this registration."

So you can use a Weblogic startup class, or the init() method in a servlet with "load-on-startup" set, to do the registration and then forget about it. Your callback will be called by the JDBC driver on another thread.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM