I have multiple data sources inserting and updating to an oracle10g database. I also have multiple clien开发者_StackOverflow中文版ts that would like to know when an insert or update has occured. I would like to know if oracle has some kind of native ability for my clients to realize that an insert or update has occured? I feel like the answer is no, but wanted to ask just in case.
Thanks!
edit: ideally push notification
There are a few different mechanisms depending on your goals.
You can use Oracle Asynchronous Queues (AQ) to publish the changes and then have your applications subscribe to the changes either via OCI or through one of the higher level Oracle AQ APIs (such as having AQ feed a JMS queue for a J2EE application).
If you are writing an OCI application, Oracle provides support for continuous query notification which is another method of pushing data to the client.
Finally, your applications could use Oracle Change Data Capture (CDC) to subscribe to changes. This last option would be more of a poll option (i.e. your application would ask every few minutes if there had been any interesting changes). The other two would be push options.
We've used DBMS_ALERT quite successfully; you can use a trigger to send an alert to a client registered to receive notifications. Effectiveness probably depends somewhat on the number and types of changes you're looking for. http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_alert.htm
精彩评论