This is an easy fix, but since it would be my first commit to this project,
I just want to see what the group preference is.  The basic problem is this:

    public void close() throws SQLException {
        GenericObjectPool oldpool = connectionPool;
        connectionPool = null;
        dataSource = null;
        try {
 ---->      oldpool.close();
        } catch(SQLException e) {
            throw e;
        } catch(RuntimeException e) {
            throw e;
        } catch(Exception e) {
            throw new SQLException(e.toString());
        }
    }

The oldpool variable is null, and unlike other places in the code, there is
no check.  The minimal change would be to change that one line by adding an
if check.  My preference would be to follow the pattern is used elsewhere in
the code for checking.  So the final code would be:

    public void close() throws SQLException {
        dataSource = null;
        if (connectionPool != null) {
            GenericObjectPool oldpool = connectionPool;
            connectionPool = null;
            try {
                oldpool.close();
            } catch(SQLException e) {
                throw e;
            } catch(RuntimeException e) {
                throw e;
            } catch(Exception e) {
                throw new SQLException(e.toString());
            }
        }
    }

Any objections?

        --- Noel


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to