Record locking

Record locking

Postby driessen » Fri Oct 05, 2007 1:58 pm

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. 24.07 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc773
User avatar
driessen
 
Posts: 1422
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Postby Antonio Linares » Fri Oct 05, 2007 5:48 pm

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
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby James Bott » Fri Oct 05, 2007 6:25 pm

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
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Antonio Linares » Fri Oct 05, 2007 7:13 pm

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
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby James Bott » Fri Oct 05, 2007 7:27 pm

Michel,

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

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Antonio Linares » Fri Oct 05, 2007 8:55 pm

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
Antonio Linares
Site Admin
 
Posts: 42079
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Rick Lipkin » Fri Oct 05, 2007 11:21 pm

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
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Postby nageswaragunupudi » Sat Oct 06, 2007 2:45 am

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

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

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10622
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Postby Gale FORd » Sat Oct 06, 2007 6:19 pm

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.
Gale FORd
 
Posts: 663
Joined: Mon Dec 05, 2005 11:22 pm
Location: Houston

Postby Rick Lipkin » Sat Oct 06, 2007 10:04 pm

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
User avatar
Rick Lipkin
 
Posts: 2665
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 83 guests

cron