Record locking

Post Reply
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Record locking

Post by driessen »

Hello,

Maybe a somewhat strange question.

If a record is locked by RLOCK(), is there any way to know who (which PC or user) locked it ?

Or is there any way to unlock a locked record by someone else ?

Thanks.
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Michel,

We have forwarded your question to Przemek who is the RDDs guru.

Lets see what he says
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Michel,

>Or is there any way to unlock a locked record by someone else ?

Even if there was, if you did it, you would create a nighmare. If one user had the record locked while editing (pesimistic locking), and another user unlocked it and saved changes, then the first user saved their changes, the second user's changes would be lost.

If you use optimistic locking (only locking during a save) then you won't run into a problem of having a locked record, since it is only locked for a split second.

James
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Przemek's answer:

> If a record is locked by RLOCK(), is there any way to know who (which
> PC or
> user) locked it ?

It depends on system which holds the locks. F.e. in Linux you can see all locks using 'lslk' command or by parsing /proc/locks where the 5-th column is PID and 6-th fileid (device and inode).

> Or is there any way to unlock a locked record by someone else ?
> Thanks,

Maybe some systems allow such operation for super user but even if they exist then it's very seldom functionality. It's extremely dangerous operation and may cause data corruption.

best regards,
Przemek
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Michel,

Maybe we should ask what you are trying to accomplish? Perhaps there is another way.

James
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Michel,

Posted by Brian Hays:

FYI, the ADS remote server does give this functionality (but not local server).
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Post by Rick Lipkin »

Michael

If you are on a Novell server there is Novlib ( blinkinc.com ) which has the ability to use the network operating system to tell you 'who' has any file open in a specific folder and who may have it locked exclusively.

Under Windows 2003 ?? I am looking for such a utility myself.

Rick Lipkin
SC Dept of Health, USA
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Post by nageswaragunupudi »

If using ADS, the management function AdsMgGetLockOwner( ... ) gives this information.

The ADSRDD for (x)Harbour has this function.
Regards

G. N. Rao.
Hyderabad, India
Gale FORd
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston
Contact:

Post by Gale FORd »

There is a utility "whohasnt" I use in windows environment. You need a certain level of access rights but it does work. You can also get onto server with remote desktop. Then run the computer management appllication. Then under Shared Folders you will find Open Files. Neither method will not tell you what record is locked, but you can see who has the file open and has at least one lock on that file.
User avatar
Rick Lipkin
Posts: 2397
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Post by Rick Lipkin »

Gale

You saying 'whohasnt' works on a Windows 2003 server to find who has files open in a certain folder .. I would very much be interested if you would not mind sharing ??

Rick Lipkin
lipkinrm29063@yahoo.com
Post Reply