Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Uniqueness of index is violated
Message
De
13/07/2001 06:39:05
Jill Derickson
Software Specialties
Saipan, CNMI
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Uniqueness of index is violated
Divers
Thread ID:
00530142
Message ID:
00530142
Vues:
61
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform