Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exclusive Record Access

Status
Not open for further replies.

DsrtFox

Programmer
Dec 8, 2006
3
US
Hello Everyone,

I inherited a Clarion Program that when in multiuser environment more than 6 users at the time when adding or updating records into one of the main tables (Btrieve) everybody that its trying to add or update a record as well get hung and the system becomes unresponsive (Deadly Embrase) I would like to use the HOLD(), RELEASE() Statements in a ABC Clarion Form, but I do not find the embed point where to issue the commands. I have been inspecting the code with Stop Statements and I have had no luck. I would like to Find the point where the get(table, key) gets issues and before that issue the hold(table) something like this:
Example:
ViewOrder VIEW(Customer) !Declare VIEW structure
PROJECT(Cus:AcctNumber,Cus:Name)
JOIN(Hea:AcctKey,Cus:AcctNumber) !Join Header file
PROJECT(Hea:OrderNumber)
JOIN(Dtl:OrderKey,Hea:OrderNumber) !Join Detail file
PROJECT(Det:Item,Det:Quantity)
JOIN(Pro:ItemKey,Dtl:Item) !Join Product file
PROJECT(Pro:Description,Pro:price)
END
END
END
END
CODE
OPEN(Customer,22h)
OPEN((Header,22h)
OPEN(Detail,22h)
OPEN(Product,22h)
SET(Cus:AcctKey)
OPEN(ViewOrder)
LOOP !Process records Loop
LOOP !Loop to avoid "deadly embrace"
HOLD(ViewOrder,1) !Arm Hold on view, try for 1 second
NEXT(ViewOrder) !Get and hold the record
IF ERRORCODE() = 43 !If someone else has it
CYCLE ! try again
ELSE
BREAK !Break if not held
END
END
IF ERRORCODE() THEN BREAK END !Check for end of file
!Process the records
RELEASE(ViewOrder) !release held records
END
CLOSE(ViewOrder)
Please Help!!! for what I can see the table its coming already open when the form gets open.
RJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top