diff options
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/jdbc2/Statement.java')
| -rw-r--r-- | src/interfaces/jdbc/org/postgresql/jdbc2/Statement.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/Statement.java b/src/interfaces/jdbc/org/postgresql/jdbc2/Statement.java index ec8632a574..4851b2d14e 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc2/Statement.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/Statement.java @@ -281,6 +281,15 @@ public class Statement extends org.postgresql.Statement implements java.sql.Stat if(escapeProcessing) sql=connection.EscapeSQL(sql); + // New in 7.1, if we have a previous resultset then force it to close + // This brings us nearer to compliance, and helps memory management. + // Internal stuff will call ExecSQL directly, bypassing this. + if(result!=null) { + java.sql.ResultSet rs = getResultSet(); + if(rs!=null) + rs.close(); + } + // New in 7.1, pass Statement so that ExecSQL can customise to it result = connection.ExecSQL(sql,this); |
