[英]Updating RowSet if table content is changed?
Is it possible to update/refresh a RowSet
's in case the table content is changed (for eg another application modifies it)? 如果表内容被更改(例如,另一个应用程序对其进行了修改),是否可以更新/刷新
RowSet
? So this way I 'always' have an up-to-date version of the table. 因此,通过这种方式,我“始终”拥有该表的最新版本。
I looked into RowSetListener
, but these events seem to get invoked only if I make modifications to the RowSet
directly. 我查看了
RowSetListener
,但是只有直接修改RowSet
才似乎会调用这些事件。 It would be enough to know that there was a change, I know... that's a lot :) 知道发生了变化就足够了,我知道...很多。:)
Please share your thoughts! 请分享您的想法! Thanks in advance!
提前致谢! Daniel
丹尼尔
No, there are no any way, for most traditional RDBMS. 不,对于大多数传统的RDBMS,没有任何办法。 Just because of http://en.wikipedia.org/wiki/ACID#Isolation
只是因为http://en.wikipedia.org/wiki/ACID#Isolation
Yes, a RowSet can be refreshed. 是的,可以刷新RowSet。 Just call its "execute()" method again.
只需再次调用其“ execute()”方法即可。
If this method is successful, the current contents of the rowset are discarded and the rowset's metadata is also (re)set.
如果此方法成功,则将丢弃行集的当前内容,并且还将(重新)设置行集的元数据。
A rowSetChanged event fires upon this refresh. 刷新时将触发rowSetChanged事件。
If you are asking if a RowSet can be automatically refreshed when data is changed on the database server: No way that I know of. 如果您要问在数据库服务器上更改数据时RowSet是否可以自动刷新:我不知道。 You may not want to know of such changes, depending on your isolation level, locking, and MVCC strategy.
您可能不希望知道这些更改,具体取决于您的隔离级别,锁定和MVCC策略。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.