void releaseConnection() throws SQLException {
        if (conn == null) {
            log.debug("not connected");
            return;
        }
        try {
            if (connector != null && connector.usesAutoRollback()) {
                try {
                    conn.rollback();
                    outputMessage("i.rollbacked");
                    log.debug("rollbacked %s (%s)", connector.getId(), conn);
                } catch (SQLException ex) {
                    log.warn(ex);
                    Writer w = new StringWriter();
                    PrintWriter out = new PrintWriter(w);
                    ex.printStackTrace(out);
                    outputMessage("e.database", w);
                    outputMessage("w.error-occurred-on-auto-rollback", ex);
                }
            }
            try {
                conn.close();
                if (log.isDebugEnabled()) {
                    final String id = (connector == null) ? "null" : connector.getId();
                    log.debug("disconnected %s (conn=%08x, env=%08x)", id, conn.hashCode(), hashCode());
                }
                if (Bootstrap.getPropertyAsBoolean("net.argius.stew.print-disconnected-time")) {
                    outputMessage("i.now", System.currentTimeMillis());
                }
            } catch (SQLException ex) {
                log.warn(ex);
                throw ex;
            }
        } finally {
            conn = null;
            connector = null;
        }
    }