Daniel Szalay
Daniel Szalay

Reputation: 4101

Updating RowSet if table content is changed?

Is it possible to update/refresh a RowSet's in case the table content is changed (for e.g. another application modifies it)? 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. 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

Upvotes: 2

Views: 419

Answers (2)

Basil Bourque
Basil Bourque

Reputation: 338406

Yes, a RowSet can be refreshed. Just call its "execute()" method again.

Per the docs:

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.

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. You may not want to know of such changes, depending on your isolation level, locking, and MVCC strategy.

Upvotes: 0

Igor Artamonov
Igor Artamonov

Reputation: 35961

No, there are no any way, for most traditional RDBMS. Just because of http://en.wikipedia.org/wiki/ACID#Isolation

Upvotes: 1

Related Questions