I don't know the RECORDLOCKU construct, though I looked it up. I know the READU with the LOCKED clause and I know it works. And I know when and under what circumstances the lock is released. It's just a matter of style, I guess it does the exact same thing (maybe. :-) ) Seems like a waste to lock a record without retrieving it. :-D
Bruce Bruce M Neylon Health Care Management Group "Brutzman, Bill" <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 05/07/2008 12:18 PM Please respond to [email protected] To "'[email protected]'" <[email protected]> cc Subject RE: [U2] Record Locking Problems Do I need a READU if I am already using a RECORDLOCKU command? --Bill -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of [EMAIL PROTECTED] Sent: Wednesday, May 07, 2008 11:34 AM To: [email protected] Subject: Re: [U2] Record Locking Problems I feel I am missing something. Why is a READU LOCKED not used? Bruce M Neylon Health Care Management Group "Brutzman, Bill" <[EMAIL PROTECTED]> Sent by: [EMAIL PROTECTED] 05/07/2008 11:00 AM Please respond to [email protected] To "'[email protected]'" <[email protected]> cc Subject [U2] Record Locking Problems I am trying to make sure that if one Customer.Service rep is updating a Sales Order, then the other Cust.Svc rep is blocked from accessing the same record. The following code will indicates that the record is locked but when the 2nd user goes in (in an independent session), the second user gets in no problem. Since it does not seem to do what I think that it should, [1] I am wondering if I am missing something. [2] I am inclined to create a file to handle this (brute force) with multivalues for user, port, time, date, program, file, record. Comments would be appreciated. --Bill SUBROUTINE SUB.LOCK.SOH.R0 ( Record.ID, Error.Code ) prompt '' open 'SOH' to F.This.File else gosub Error.Opening.File gosub Lock.And.Hold go The.End *--------------------------------------------------------------------------- -- *--------------------------------------------------------------------------- -- Lock.And.Hold: Lock.Test = recordlocked (F.This.File, Record.ID) crt '**11 Lock.Test ' : Lock.Test : ' [<] ' input Ans begin case case Lock.Test = 0 ; recordlocku F.This.File, Record.ID case 1 ; gosub Error.Record.Locked end case Lock.Test = recordlocked (F.This.File, Record.ID) crt '**12 Lock.Test ' : Lock.Test : ' [<] ' input Ans return *--------------------------------------------------------------------------- --- Error.Record.Locked: Lock.Test = recordlocked (F.This.File, Record.ID) crt '**13 Lock.Test ' : Lock.Test : ' [<] ' input Ans Error.Code = 'E' crt @(-1) crt @(-5) crt crt crt crt crt crt crt crt crt crt ' ' : @(-6) crt crt ' ___________________________ ' crt ' \ \ ' crt ' \ Error, Record Locked \ ' crt ' \__________________________\ Try Later ' crt ' ' crt ' ' crt ' [X] ' crt ' ' : input Ans, 1 Ans = upcase(Ans) begin case case Ans = 'X' ; null case 1 ; go Error.Record.Locked end case return *--------------------------------------------------------------------------- --- Error.Opening.File: crt @(-1) crt @(-5) crt crt crt crt crt crt crt crt crt crt crt crt ' Big Problem... ' : @(-6) crt crt ' _________________________ ' crt ' \ \ SOH ' crt ' \ Error Opening File \ ' crt ' \________________________\ Contact HK.IT ' crt ' [X] ' crt ' ' : input Ans, 1 Ans = upcase(Ans) begin case case Ans = 'X' ; null case 1 ; go Error.Opening.File end case return to The.End *--------------------------------------------------------------------------- --- The.End: RETURN END ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/ ------- u2-users mailing list [email protected] To unsubscribe please visit http://listserver.u2ug.org/
