Uniqueness of attributes ...

Ashley Aitken <[email protected]> Mon, 3 May 2004 17:15:03 +0800
Newsgroups gmane.comp.web.webobjects.eof
Message-ID <[email protected]>
Howdy All,

I need to ensure a non-primary key (non-foreign key) attribute is 
unique.

The "obvious" way of doing this is to do a fetch on that property when 
validating the attribute to see if any records currently exist with 
that value.

Is that the best way of doing it (with EOF)?   Surely "another process" 
could enter a row with that value between when I fetch to check and 
then save the row ...

Is there someway of telling the database (generically) that this 
attribute should be unique, and it automatically causing an exception 
if a duplicate value is saved.

I don't want to get into database specifics, I want to keep this at the 
EOF level.

Thanks,
Ashley.

--
Ashley Aitken
Perth, Western Australia
mrhatken at mac dot com