Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File locking
Message
From
25/07/2000 17:12:42
 
 
To
25/07/2000 16:06:59
Steve Summers
Pima County Superior Court
Tucson, Arizona, United States
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00396725
Message ID:
00396794
Views:
8
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
Previous
Reply
Map
View

Click here to load this message in the networking platform