Keeping a copy of fetched data in embedded SQL applications

In some situations, it might be useful to maintain a copy of data that is fetched by the application.

Procedure

To keep a copy of the data, your application can do the one of the following tasks:

  • Save the fetched data in virtual storage.
  • Write the data to a temporary file (if the data does not fit in virtual storage). One effect of this approach is that a user, scrolling backward, always sees exactly the same data that was fetched, even if the data in the database was changed in the interim by a transaction.
  • Using an isolation level of repeatable read, the data you retrieve from a transaction can be retrieved again by closing and opening a cursor. Other applications are prevented from updating the data in your result set. Isolation levels and locking can affect how users update data.