private boolean insertStrict(T model, Long oldUpdatedAt) throws JackException, IOException {
    PreparedStatement insertStmt = conn.getPreparedStatement(getInsertWithIdStatement(fieldNames));
    try {
      setAttrs(model, insertStmt);
      insertStmt.setLong(fieldNames.size() + 1, model.getId());
      insertStmt.execute();
      final int updateCount = insertStmt.getUpdateCount();
      insertStmt.close();

      if (updateCount > 1) {
        throw new TooManyRowsUpdatedException();
      } else if (updateCount < 1) {
        revertRailsUpdatedAt(model, oldUpdatedAt);
        throw new StaleModelException();
      } else {
        if (useCache) {
          cachedById.put(model.getId(), model);
        }
        clearForeignKeyCache();
        model.setCreated(true);
        return true;
      }
    } catch (SQLException e) {
      revertRailsUpdatedAt(model, oldUpdatedAt);
      throw new IOException(e);
    }
  }