Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Uniqueness of index is violated
Message
De
17/07/2001 16:00:34
Jill Derickson
Software Specialties
Saipan, CNMI
 
 
À
17/07/2001 13:06:12
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00530142
Message ID:
00531707
Vues:
15
Thanks for that Sasha, but I never delete records from the file...when it's accessibly EXCLUSIVEly, I ZAP it.

J
>Check out the SET DELETED setting. Maybe there are deleted records in a file with the same ID.
>
>>Hello,
>>
>>I have a "semaphore" file, ReserveGroup.DBF; it has one integer field,
>>GROUP, which is also it's primary index, GROUP.
>>
>>While reservations are being changed in a group, the function LockGroup is
>>called; a record in this table is created (if none exists) with the group
>>number and the record is locked. Once the reservation changes have been
>>completed, the record is unlocked.
>>
>>Sometimes, the system generates the error "Uniqueness of index GROUP is
>>violated" (the error shows in ther error log - 11 times in June, 5 times so
>>far in July; different users, different computers). I can't reproduce this
>>problem.
>>
>>ReserveGroup is opened in the Data Environment of the form, w/buffer mode of
>>0, and it's order set to GROUP.
>>
>>This is a peer-to-peer Windows network.
>>
>>The error occurs at line 10 in the following function...does anyone have any
>>suggestions about how to avoid the error?
>>
>>TIA, J
>>
>>
** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** **
>>** lock GROUP while updating or DELETing
>>FUNCTION LockGroup
>>
>>LPARAMETER nGroupToLock
>>
>>LOCAL cTheAlias, lLocked
>>
>>cTheAlias = ALIAS()
>>
>>SELECT ReserveGroup
>>IF !SEEK( nGroupToLock )
>> INSERT INTO ReserveGroup VALUES ( nGroupToLock )
>>ENDIF
>>IF LOCK()  && lock the record
>> lLocked = .T.
>>ELSE
>> lLocked = .F.
>> WAIT WINDOW RecBusyMsg
>>ENDIF
>>SELECT ( cTheAlias )
>>RETURN lLocked
>>** End LockGroup
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform