The following situations and their solutions may be helpful if you notice increased memory use in jConnect applications.
In jConnect applications, you should explicitly close all Statement objects and subclasses (for example, PreparedStatement, CallableStatement) after their last use to prevent statements from accumulating in memory. Closing only the ResultSet is not sufficient.
For example, the following statement causes problems:
ResultSet rs = _conn.prepareCall(_query).execute();
... rs.close();
Instead, use the following:
PreparedStatement ps = _conn.prepareCall(_query); ResultSet rs = ps.executeQuery();
... rs.close(); ps.close();
Native support for Scrollable or Updatable Scrollable cursors may not be available depending on the version of Adaptive Server or SQL Anywhere database you are connecting to. To support scrollable or updatable scrollable cursors when not supported natively by the backend server, jConnect caches the row data on demand, on the client, on each call to ResultSet.next. However, when the end of the result set is reached, the entire result set is stored in client memory. Because this may cause a performance strain, Sybase recommends that you use TYPE_SCROLL_INSENSITIVE result sets only when the result set is reasonably small. With this release, jConnect determines if the Adaptive Server connection supports native scrollable cursor functionality and uses it instead of client-side caching. As a result, most applications can expect significant performance gain in accessing out-of-order rows and reduction in client-side memory requirements.