Subject | Memory leak in repetitive createStatement when autoCommit is set to true |
---|---|
Author | s_palchik |
Post date | 2006-08-16T13:12:09Z |
When i try to test repetitive createStatement when autoCommit for
connection is set to false i found memory leak. Piece of code example
is below. May be, i'm doing smth wrong, or this is a bug in driver or
smth else? I test this with Jaybird 1.5, Jaybird 2.0 and Jaybird 2.1.
When autoCommit is set to true all ok.
Connection ñ = Configuration.getInstance().getConnection();
try {
c.setAutoCommit(false);
} catch (Exception e) {}
for (int i = 0; i < 100000; i++) {
Statement ss = null;
ResultSet rr = null;
try{
ss = c.createStatement();
rr = ss.executeQuery("select * from emplyees");
rr.next();
} catch (Exception e) {
} finally {
try {
rr.close;
} catch (Exception ww) {}
try{
ss.close();
} catch (Exception ee) {}
}
}
connection is set to false i found memory leak. Piece of code example
is below. May be, i'm doing smth wrong, or this is a bug in driver or
smth else? I test this with Jaybird 1.5, Jaybird 2.0 and Jaybird 2.1.
When autoCommit is set to true all ok.
Connection ñ = Configuration.getInstance().getConnection();
try {
c.setAutoCommit(false);
} catch (Exception e) {}
for (int i = 0; i < 100000; i++) {
Statement ss = null;
ResultSet rr = null;
try{
ss = c.createStatement();
rr = ss.executeQuery("select * from emplyees");
rr.next();
} catch (Exception e) {
} finally {
try {
rr.close;
} catch (Exception ww) {}
try{
ss.close();
} catch (Exception ee) {}
}
}