Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
File locking
Message
De
25/07/2000 17:12:42
 
 
À
25/07/2000 16:06:59
Steve Summers
Pima County Superior Court
Tucson, Arizona, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Divers
Thread ID:
00396725
Message ID:
00396794
Vues:
7
This will be my save method of my base class
****************************************



LOCAL llUpdate, lnSelect, lcScanCond, lnRepocess

#define ccScanCond THIS.cBizID $ UPPER( gwtable.gwbizidlist) AND NOT EMPTY( gwtable.gwviewname)

llUpdate = .T.
lnSelect = SELECT()
lnReprocess = set("reprocess")
set reprocess to 4 seconds

SELECT gwtable


if this.lSafeSave
* Wrap the whole thing in a BEGIN/END TRANSACTION so we can rollback.
BEGIN TRANSACTION

* Spin through and try to update all views.
SCAN ALL FOR ccScanCond AND llUpdate
* Parm 1 is 1 for all rows, and parm 2 is .T. for force update even
* if someone else updated the record already.
llUpdate = llUpdate AND TABLEUPDATE( 1, .T., ALLTRIM(gwtable.gwviewname))
ENDSCAN

IF llUpdate
END TRANSACTION
ELSE
ROLLBACK
ENDIF
else

*/ lock all associated files before updating
SCAN ALL FOR ccScanCond
sele alltrim(gwtable.gwalias)
llUpdate = flock()
*/ leave when unsuccessful file lock
if not llUpdate
exit
endif
endscan

SELECT gwtable
SCAN ALL FOR ccScanCond
*/ update only if file locks were successful
if llUpdate
llupdate = TABLEUPDATE( 1, .T., ALLTRIM(gwtable.gwviewname))
endif
unlock in alltrim(gwtable.gwalias)
ENDSCAN
endif

SELECT (lnSelect)
set reprocess to lnReprocess

RETURN llUpdate
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform