Subject | A suggestion |
---|---|
Author | Robert DiFalco |
Post date | 2003-10-22T18:15:37Z |
Keeping fields around when you cache prepared-statements can really
become a drag, especially for large BLOBs and Strings.
Here's my suggestion. Current FBPreparedStatement looks like this:
public void clearParameters() throws SQLException {
for (int i = 0; i < isParamSet.length; i++)
isParamSet[i] = false;
}
I think it would work if you did something like this:
public void clearParameters() throws SQLException {
for (int i = 0; i < isParamSet.length; i++) {
field[i].setObject( null ); // free data
isParamSet[i] = false;
}
Then, in my CachedPreparedStatment#close method, I can just call
#clearParmaters to reclaim storage and make object available for garbage
collecting.
become a drag, especially for large BLOBs and Strings.
Here's my suggestion. Current FBPreparedStatement looks like this:
public void clearParameters() throws SQLException {
for (int i = 0; i < isParamSet.length; i++)
isParamSet[i] = false;
}
I think it would work if you did something like this:
public void clearParameters() throws SQLException {
for (int i = 0; i < isParamSet.length; i++) {
field[i].setObject( null ); // free data
isParamSet[i] = false;
}
Then, in my CachedPreparedStatment#close method, I can just call
#clearParmaters to reclaim storage and make object available for garbage
collecting.