scristalli / sql-developer-keepalive

MIT License
149 stars 21 forks source link

Keepalive plugin leaves open cursors #13

Closed jdiazest closed 8 years ago

jdiazest commented 9 years ago

Keepalive plugin leaves open cursors when having several connections configured, and after some time with plugin enabled, the following error appears:

KEEPALIVE [08:29:34] INFO: keepalive event triggered, scanning 14 connections... KEEPALIVE [08:29:35] ERROR: ORA-01000: número máximo de cursores abiertos excedido

Looking at ConnectionPinger.java, it can be seen that only the Statement of the last connection is closed:

while (this.execute) {
            Statement sqlStatement = null;
            try {
...
                for (int i = 0; i < l.length; i++) {
....
                        sqlStatement = Connections.getInstance().getConnection(connectionName).createStatement();
....
                }
....
            } finally {
                if (sqlStatement != null) {
                    try {
                        sqlStatement.close();
                    } catch (SQLException e) {
                        LogMessage("ERROR", e.getMessage());
                    }
                }
            }
        }
scristalli commented 8 years ago

Resolved in Release 1.3 thanks to jdiazest.