if (logSql) { long logTimeStop = System.currentTimeMillis(); logSqlStatement("SQL SELECT_NEXTVAL", map.getTableName(), logTimeStart, logTimeStop, q); }
    public String generateID(DbMapping map) throws Exception {        // Transactor tx = (Transactor) Thread.currentThread ();        // tx.timer.beginEvent ("generateID "+map);        Statement stmt = null;        String retval = null;        try {            Connection con = map.getConnection();            String q = new StringBuffer("SELECT ").append(map.getIDgen())                                                  .append(".nextval FROM dual").toString();            stmt = con.createStatement();            ResultSet rs = stmt.executeQuery(q);            if (!rs.next()) {                throw new SQLException("Error creating ID from Sequence: empty recordset");            }            retval = rs.getString(1);        } finally {            // tx.timer.endEvent ("generateID "+map);            if (stmt != null) {                try {                    stmt.close();                } catch (Exception ignore) {                }            }        }        return retval;    }