Set a unique set of attributes excluding id. If insert failed because it already exists get the conflicting id.