if (count == 0) {
// update count is 0, meaning such a row already exists
// DELETE FROM DATASTORE WHERE ID=?
conn.executeStmt(deleteSQL, new Object[]{tempId});
// SELECT LENGTH, LAST_MODIFIED FROM DATASTORE WHERE ID=?
prep = conn.executeStmt(selectMetaSQL, new Object[]{id});
rs = prep.getResultSet();
if (rs.next()) {
long oldLength = rs.getLong(1);
long lastModified = rs.getLong(2);
if (oldLength != length) {