
Chapter 3 Troubleshooting
Memory usage in jConnect applications
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 the ResultSet is not sufficient.
For example:
ResultSet rs = _conn.prepareCall(_query).execute();
...
rs.close();
will cause problems. Instead use:
PreparedStatement ps = _conn.prepareCall(_query);
ResultSet rs = ps.execute();
...
ps.close();
rs.close();
- jConnect uses the Tabular Data Stream (TDS)--Sybase's
proprietary protocol--to communicate with Sybase database
servers. As of jConnect 5.0, TDS does not support scrollable cursors.
To support scrollable cursors, 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 the client's 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.
Copyright © 2001 Sybase, Inc. All rights reserved.
|
|