Re: [U2] Record Locking Problems

2008-05-08 Thread Jonathan D Smith
Hi Karen,

For reference  although the RECORDLOCKU statement does not support an 
array in it's syntax it does read the record on UniVerse, it does not on 
UniData. Your assumption is correct that it shouldn't read the record, as 
it only needs to access the lock table which is a memory structure, if you 
want to test this for yourself do a test on UniData and UniVerse on 
RECORDLOCKU v READU and you'll see there is almost no time difference on 
UniVerse.

Regards,

Jonathan D Smith
SWG Client Support - Software
U2 Service Delivery Team
Technical Support Consultant








Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU

[demime 1.01d removed an attachment of type image/jpeg]
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Record Locking Problems

2008-05-08 Thread Dennis Bartlett
 I am certainly NOT trying to change anyone's coding style, I am just
curious

IMPRESSIVELY POLITICALLY CORRECT ;-)
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Record Locking Problems

2008-05-08 Thread Richard Taylor
I assume that the SUB.LOCKED.SOH.RO is called to do the lock and then
returns.

The problem is that you open the file in this routine to do the locking
against.  Once this subroutine ends that file handle will go out of scope
(it was defined local to this subroutine) and the file is closed.  That
releases the lock.

The best way would be to pass in an open file handle.  If that is not
possible for some reason then open the file to a variable defined in named
common and test to see if it is already open using FILEINFO() before
attempting to do the open.

such as:

COMMON /MY.FILE.HANDLES/ F.THIS.FILE

IF FILEINFO(F.THIS.FILE,0) = 0 THEN
OPEN .
END


I would prefer passing in the open file handle myself if possible.  Named
common is very useful, but care needs to be taken in it's use.  For example
the common memory defined is associated to the process and not the account.
Therefore if you logto another account without first exiting U2 the file
handle would still be open, BUT pointed at the file in the account where it
was opened.   You would need to have logic in the logins to test for this
or add additional checks (using FILEINFO again for the path where the file
is located)

Rich Taylor | Senior Programmer/Analyst| VERTIS
250 W. Pratt Street | Baltimore, MD 21201
P 410.361.8688 | F 410.454.8392
[EMAIL PROTECTED] | http://www.vertisinc.com

Vertis is the premier provider of targeted advertising, media, and
marketing services that drive consumers to marketers more effectively.

The more they complicate the plumbing
  the easier it is to stop up the drain

- Montgomery Scott NCC-1701



   
 Brutzman, Bill  
 [EMAIL PROTECTED] 
 ft.comTo 
 Sent by:  'u2-users@listserver.u2ug.org'
 [EMAIL PROTECTED] u2-users@listserver.u2ug.org  
 stserver.u2ug.org  cc 
   
   Subject 
 05/07/2008 12:02  [U2] Record Locking Problems
 PM
   
   
 Please respond to 
 [EMAIL PROTECTED] 
er.u2ug.org
   
   




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

  goThe.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 ' 

Re: [U2] Record Locking Problems

2008-05-07 Thread BNeylon
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
u2-users@listserver.u2ug.org


To
'u2-users@listserver.u2ug.org' u2-users@listserver.u2ug.org
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

  goThe.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
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Record Locking Problems

2008-05-07 Thread doug chanco

why not do a READU using the LOCKED clause?  Something like

READU ORDER.ITEM FROM F.ORDER LOCKED
   PRINT 'record is locked ..'
   INPUT JUNK
END ELSE
   * I got the record AND locked it, so do my thing .
END

you could even loop around a couple of times to see if the lock releases 
and after x times inform the user that the record is locked ...


dougc


Brutzman, Bill wrote:

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

  goThe.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
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Record Locking Problems

2008-05-07 Thread Brutzman, Bill
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: u2-users@listserver.u2ug.org
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
u2-users@listserver.u2ug.org


To
'u2-users@listserver.u2ug.org' u2-users@listserver.u2ug.org
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

  goThe.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
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Record Locking Problems

2008-05-07 Thread Bessel, Karen
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: u2-users@listserver.u2ug.org
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
u2-users@listserver.u2ug.org


To
'u2-users@listserver.u2ug.org' u2-users@listserver.u2ug.org
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

  goThe.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
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


Re: [U2] Record Locking Problems

2008-05-07 Thread doug chanco

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: u2-users@listserver.u2ug.org
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
u2-users@listserver.u2ug.org


To
'u2-users@listserver.u2ug.org' u2-users@listserver.u2ug.org
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

  goThe.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

RE: [U2] Record Locking Problems

2008-05-07 Thread BNeylon
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
u2-users@listserver.u2ug.org


To
'u2-users@listserver.u2ug.org' u2-users@listserver.u2ug.org
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: u2-users@listserver.u2ug.org
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
u2-users@listserver.u2ug.org


To
'u2-users@listserver.u2ug.org' u2-users@listserver.u2ug.org
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

  goThe.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
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users

RE: [U2] Record Locking Problems

2008-05-07 Thread Bessel, Karen
Recordlocku does not read the record...





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 Brutzman, Bill
Sent: Wednesday, May 07, 2008 11:18 AM
To: 'u2-users@listserver.u2ug.org'
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: u2-users@listserver.u2ug.org
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
u2-users@listserver.u2ug.org


To
'u2-users@listserver.u2ug.org' u2-users@listserver.u2ug.org
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

  goThe.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
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Record Locking Problems

2008-05-07 Thread Allen E. Elwood
And yet his results pretty much show they don't.

I'd fall back and punt and just use the READU

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Bessel, Karen
Sent: Wednesday, May 07, 2008 09:24
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Record Locking Problems


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: u2-users@listserver.u2ug.org
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
u2-users@listserver.u2ug.org


To
'u2-users@listserver.u2ug.org' u2-users@listserver.u2ug.org
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

  goThe.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
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users

RE: [U2] Record Locking Problems

2008-05-07 Thread Thomas Derwin
By using READU, you can also do fun things when your code takes the
locked clause, such as offering an inquiry-only mode (i.e. updates are
disabled), which is terribly user-friendly. And/or you can display who's
locking the record so the lockee can contact the locker, also
terribly user-friendly.

Have fun,
Tom Derwin

 [EMAIL PROTECTED] 05/07/08 1:25 PM 
And yet his results pretty much show they don't.

I'd fall back and punt and just use the READU

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Bessel, Karen
Sent: Wednesday, May 07, 2008 09:24
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] Record Locking Problems


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
snip
- This e-mail and any attachments may 
contain CONFIDENTIAL information, including PROTECTED HEALTH INFORMATION. If 
you are not the intended recipient, any use or disclosure of this information 
is STRICTLY PROHIBITED; you are requested to delete this e-mail and any 
attachments, notify the sender immediately, and notify the LabCorp Privacy 
Officer at [EMAIL PROTECTED] or call (877) 23-HIPAA / (877) 234-4722. 
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Record Locking Problems

2008-05-07 Thread David Murray
Bill,

The RECORDLOCKED returns a number of values, the value of 1 states that
this user has a record lock, not another user.

Try using an else on the case structure.

Cheers,

David Murray
 


*   
Learn and do 
*   Excel and share 
 
http://u2blog.org

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Brutzman, Bill
Sent: Wednesday, May 07, 2008 11:00 AM
To: 'u2-users@listserver.u2ug.org'
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

  goThe.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
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Record Locking Problems

2008-05-07 Thread JPB-U2UG
Your code doesn't test for the type of lock. It could be just a shared
record lock which would allow another user to get in.

Jerry Banker
Senior Programmer Analyst
IBM Certified Solutions Expert

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Brutzman, Bill
Sent: Wednesday, May 07, 2008 10:00 AM
To: 'u2-users@listserver.u2ug.org'
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

  goThe.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
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/


RE: [U2] Record Locking Problems

2008-05-07 Thread David Jordan
Bill

I think your problem is related to re-opening the file in the subroutine.  
Everytime you open a file you clear all the previous locks.  Ie the user
opens file, locks record and then opens file again there is no record locks.

Use a fileinfo statement to check file is open and if it is skip opening it.

Regards
---
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/