Record locking
Record locking
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.
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
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
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
>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
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
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
> 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
- James Bott
- Posts: 4654
- Joined: Fri Nov 18, 2005 4:52 pm
- Location: San Diego, California, USA
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Rick Lipkin
- Posts: 2397
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
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
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
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
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.
- Rick Lipkin
- Posts: 2397
- Joined: Fri Oct 07, 2005 1:50 pm
- Location: Columbia, South Carolina USA
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
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