Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multiuser file access
Message
De
06/12/2013 10:11:54
 
 
À
06/12/2013 10:09:10
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Web
Divers
Thread ID:
01589362
Message ID:
01589450
Vues:
53
FLOCK() is bad in multiuser scenarios. There's no reason to lock a file to do an INSERT INTO. You comment raises the question of how your code generates the primary key.

>Are you saying that with INSERT INTO, I don't need flock()?
>I guess that 'Log file' is inaccurate. It's a list of emails that have a lSent field. If the previous attempt was unsuccessful and it is successful now, I want to update the lSent to .t.
>
>
>PROCEDURE UpdateEmailLog(tcText, tcCustno, tcDisposition)
>
>LOCAL lnSelect, llUpdated
>
>lnSelect = SELECT()
>
>SELECT emails
>
>llUpdated = .F.
>
>DO WHILE !llUpdated
>
>	IF FLOCK()
>		APPEND BLANK
>		REPLACE em_body WITH tcText, ;
>			em_datetim WITH DATETIME(), ;
>			em_custno WITH tcCustno, ;
>			em_disptn WITH tcDisposition
>
>		UNLOCK
>		llUpdated = .t.
>	ENDIF
>
>ENDDO
>
>
>SELECT (lnSelect)
>
>RETURN
>
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform