Hi Wendy,

hmm......

I think I understand.

You could READU the PERSON file with just the datafield as the ID to 'lock'
that UserID, then proceed with the rest of the logic as is.  You don't even
need to WRITE the UserID as a record to the PERSON file, just use it as a
precursor to the rest of your logic which I assume has a field*field locking
scheme already in place.  This way if another user tried the UserID a
millisecond after the first user, you could send a 'please wait' message,
until the UserID was RELEASE'd by the first process.  Then use an index to
tell the second guy he was out of luck and to try another user name.

Sounds like it should work........

hth!

Allen E. Elwood
Senior Programmer Analyst
Sysmark Information Systems, Inc.
Direct (818) 361-5251
Fax    (818) 361-5251
Cell    (818) 359-8162
Home (818) 361-7217

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Wendy Smoak
Sent: Friday, October 08, 2004 13:12
To: [EMAIL PROTECTED]
Subject: RE: [U2] Enforcing uniqueness of two fields per record?


> Richard A. Wilson wrote:
> cant you just index both fields and use your check index logic

That's what I do now, but there's no guarantee of uniqueness.  The key
is guaranteed unique-- you just can't write two records with the same
key.  But AFAIK nothing is going to stop me writing two records with a
data field set to the same value.

I think I have concurrency issues-- if two users try for the same UserID
at the same time, they could both "think" they've got it.  (Same code
running twice, one just after the other.)

That's why I'm thinking to use a database trigger to move that final
check as close to the write as possible.

--
Wendy Smoak
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to