285 pts.
 Record lock
I have ecounter a situation where my program is updating a record which is locked by another user. Can anybody suggest on developing a process using CL program which can handle such kind of situation where my CL program will send a message to the user who has put a lock and after waiting for some time my rogram should again fire update command from COBOL/400 program. Thanks in advance.

Software/Hardware used:
ASKED: September 26, 2008  10:06 AM
UPDATED: October 6, 2011  7:24 AM

Answer Wiki:
I have an old RPG example that uses a CL to send a message to the user locking the record. If you are interested, shoot me your e-mail and I'll send the code. Even though its old, it will give you a good idea of what can be done.
Last Wiki Answer Submitted:  September 26, 2008  6:12 pm  by  WoodEngineer   5,525 pts.
All Answer Wiki Contributors:  WoodEngineer   5,525 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

yes please.
my email is vidu21@gmail.com

Thanks

 285 pts.

 

Hi,
Pls send me the code to me also.My Email Id is msali37@gmail.com

 370 pts.

 

Here are some other ideas and techniques.

The example RPG code at the link below is old, and could be implemented today in /Free without numbered indicators, etc., but illustrates the approach. I like the idea of displaying a window informing the user who needs the lock that someone else already has that record locked. And ideally, a message could also be sent to the user who has the lock, to inform them that someone else needs it and to ask them to please finish their work on that record and to release it, etc.
http://www.mcpressonline.com/tips-techniques/programming/techtalk-who-locked-the-record.html

And this one has a link to some code that can be downloaded.
http://systeminetwork.com/article/easily-respond-object-and-record-lock-events

 4,275 pts.

 

If it’s an ODBC process holding the lock, how will you send the message? If it’s a batch job holding the lock, how will you display a menu? If you don’t have authority to the offending job, how will you do anything at all with it?

Why is your job more important than the job holding the lock? What if no one is at the workstation?

In short, the lock isn’t the problem and sending a message won’t solve it on an ongoing basis. The problem is the design of the application — it shouldn’t allow standing locks in the first place. Eliminate the locks; don’t just complain (message) about them.

Tom

 107,995 pts.

 

WoodEngineer, if you would be so kind as to also send me a copy of your CL it would be appreciated. My address is atroxdesign {at} swbell {dot} net.

 5,670 pts.

 

You need a design level standard

Don’t lock the record.

Don’t ever write anything that locks a record – ever.

Except just before you update it.

read and display
read and display
decide an update is needed

read the record for update (lock)
check it hasn’t changed since you displayed it ( tell the user if so)
update it
release the lock

read and display
read and display
blahblah

 5,505 pts.