基于Oracle JDBC数据库更改通知更新表 [英] Updating tables based on Oracle JDBC Database Change Notification

查看:137
本文介绍了基于Oracle JDBC数据库更改通知更新表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取更新的行(例如行数据/行说明)的更改通知。我可以获取更新的行ID。

How to get change notifications for rows updated such as row data/row description. I am able to get rows Id's which are updated.

我需要根据我在更新Table1之后获得的行ID来同步Table1和Table2。我已阅读了几个关于通知的网站,但找不到任何有关如何根据通知更新表格的信息。请帮助!!

I need to sync Table1 with Table2 based on the row Id's that I get as notification after updating Table1. I have read on few sites about notifications, but couldn't find any information on how to update a table based on notification. Please help!!

以下是在Oracle上找到的一些帮助信息网站

Below is some help information I found on Oracle website:


中间层需要快速访问数据库对象的高速缓存副本
,同时在与数据库的
关联中保持尽可能高的缓存。当事务修改数据和提交时,缓存数据变得过时或失效
,从而使
应用程序有访问不正确结果的风险。如果应用程序
使用数据库更改通知,那么当对已更改的详细信息
发生更改时,Oracle数据库可以发布
通知。

Applications in the middle tier require rapid access to cached copies of database objects while keeping the cache as current as possible in relation to the database. Cached data becomes out of date or "stale" when a transaction modifies the data and commits, thereby putting the application at risk of accessing incorrect results. If the application uses Database Change Notification, then Oracle Database can publish a notification when a change occurs to registered objects with details on what changed.

响应该通知,应用程序可以通过从后端数据库中获取缓存的
数据来刷新缓存的
数据。

In response to the notification, the application can refresh cached data by fetching it from the back-end database.


推荐答案

查看您引用的应用程序开发人员指南我注意到,使用数据库更改通知开发应用程序中的第六段说明:

Looking at the Application Developer's Guide you cited I note that about the sixth paragraph under the "Developing Applications with Database Change Notification" states:


通知只包含已更改的行或对象的元数据,而不包含更改的数据本身。

The notification contains only metadata about the changed rows or objects rather than the changed data itself.

是一种让Oracle告诉你 FIELD_X DESCRIPTION 或任何改变的方法。收到通知您表格和ROWID的更改通知后,您需要出去并获取已更改的数据(如果适用),并更新缓存的副本。

So there doesn't appear to be a way to get Oracle to tell you that FIELD_X or DESCRIPTION or whatever changed. Once the change notification is received which tells you the table and the ROWID you need to go out and fetch the data which was altered (if that's appropriate), and update the cached copy.

您的里程可能会有所不同。

Your mileage may vary.

分享并享受。

这篇关于基于Oracle JDBC数据库更改通知更新表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆