From the universe documentation

Description
Use RECORDLOCK statements to acquire a record lock on a record without reading the record.

Description
Use the RECORDLOCKED function to return the status of a record lock.

I too may be missing something but why get a lock on a record without reading the record and why check if a record is locked before trying to read/lock it when READU does all that for you?

it seems to me that the code could be simplified by using a READU which tests if the record is locked and locks it for you if its not.

I am certainly NOT trying to change anyone's coding style, I am just curious ..........

dougc



Bessel, Karen wrote:
I think he's using the recordlocked and recordlocku syntax to illustrate
his problem. From the documentation that I've read on those two commands
(which I'd never seen before today), this should work.




Karen Bessel
Software Developer

Tyler Technologies, Inc.
6500 International Parkway, Suite 2000
Plano, TX 75093
Phone: 972.713.3770 ext:6227
Fax: 972.713.3777 Email: [EMAIL PROTECTED]
Web: http://www.tylertech.com
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Wednesday, May 07, 2008 10: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/

Reply via email to