Release 10.1A: OpenEdge Development:
Java Open Clients

> ## Understanding SDOResultSet scrolling modes

> Different scrolling modes allow you to control response time, memory requirements, and the ResultSet isolation level. The isolation level (in this context) is the visibility of modifications made to the ResultSet by applications other than the current Open Client. Each mode represents tradeoffs between these requirements and capabilities. You can set the scrolling mode on the `SDOParameters` object using the `setScrollingMode(SDOScrollingMode` `constant``)` method and pass the object to the `_createSDOResultSet()` factory method. These are the values you can pass for `constant`:

> - `SDOScrollingMode.PREFETCH` — This is the default and only allowable mode for a stateless SDOResultSet. In this mode, the whole ResultSet is fetched into memory when the SDOResultSet object is created. The response time and amount of memory required is directly related to the size of the ResultSet. This mode creates the highest level of isolation. (For more information, see the information on visibility of updates in the "Updating SDOResultSet objects" section.) The size of the ResultSet is known from the beginning and does not change until the ResultSet is closed or the query is reopened. Also, navigation in this mode is guaranteed to be fast since all the rows are in memory. This mode is ideal for small ResultSets in combination with slow networks.

> Note: If you are accessing a large ResultSet, you might want to use the `setPrefetchMaxRows()` method to limit the number of rows you fetch. Otherwise, your Java application can run with an excessively long response time and large memory consumption. This can be a special problem for applications accessing stateless SDOResultSets, which always are in the `PREFETCH` scrolling mode. For more information, see the "Understanding SDOResultSet stateless mode" section.

> - `SDOScrollingMode.KEEP_ROWS` — This is the default mode for an SDOResultSet that is not stateless. The rows are not prefetched but retrieved from the AppServer on demand. Rows that were retrieved are kept in memory until the ResultSet is closed or a row is refreshed or updated. The response time to get the first rows in `KEEP_ROWS` mode is shorter than in `PREFETCH` mode. Stateless SDOResultSets do not support this mode (see the "Understanding SDOResultSet stateless mode" section).

> - `SDOScrollingMode.FORWARD_ONLY` — In this mode, only the `next()` navigation method is supported; the cursor cannot be randomly repositioned. Since there is no need to maintain an in-memory cache of rows, the amount of required memory does not depend on the size of the ResultSet. This scrolling mode should be used, therefore, when a large ResultSet is accessed and the `next()` method is sufficient; no other navigation methods are required.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095