cleanup(conn, stmt, null);
cleanup(conn, null, null);
    public Step createCurrentStep(long entryId, int wfStepId, String owner, Date startDate, Date dueDate, String status, long[] previousIds) throws StoreException {        Connection conn = null;        PreparedStatement stmt = null;        try {            conn = getConnection();            String sql = "INSERT INTO " + currentTable + " (" + stepId + "," + stepEntryId + ", " + stepStepId + ", " + stepActionId + ", " + stepOwner + ", " + stepStartDate + ", " + stepDueDate + ", " + stepFinishDate + ", " + stepStatus + ", " + stepCaller + " ) VALUES (?, ?, ?, null, ?, ?, ?, null, ?, null)";            if (log.isDebugEnabled()) {                log.debug("Executing SQL statement: " + sql);            }            stmt = conn.prepareStatement(sql);            long id = getNextStepSequence(conn);            stmt.setLong(1, id);            stmt.setLong(2, entryId);            stmt.setInt(3, wfStepId);            stmt.setString(4, owner);            stmt.setTimestamp(5, new Timestamp(startDate.getTime()));            if (dueDate != null) {                stmt.setTimestamp(6, new Timestamp(dueDate.getTime()));            } else {                stmt.setNull(6, Types.TIMESTAMP);            }            stmt.setString(7, status);            stmt.executeUpdate();            if ((previousIds != null) && (previousIds.length > 0)) {                if (!((previousIds.length == 1) && (previousIds[0] == 0))) {                    sql = "INSERT INTO " + currentPrevTable + " (" + stepId + ", " + stepPreviousId + ") VALUES (?, ?)";                    log.debug("Executing SQL statement: " + sql);                    cleanup(null, stmt, null);                    stmt = conn.prepareStatement(sql);                    for (int i = 0; i < previousIds.length; i++) {                        long previousId = previousIds[i];                        stmt.setLong(1, id);                        stmt.setLong(2, previousId);                        stmt.executeUpdate();                    }                }            }            return new SimpleStep(id, entryId, wfStepId, 0, owner, startDate, dueDate, null, status, previousIds, null);        } catch (SQLException e) {            throw new StoreException("Unable to create current step for workflow instance #" + entryId, e);        } finally {            cleanup(conn, stmt, null);        }    }