Is it possible to find out which user has a ROWLOCK on a table?

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
mjbcomp
Posts: 2
Joined: Wed 14 Apr 2021 03:45

Is it possible to find out which user has a ROWLOCK on a table?

Post by mjbcomp » Wed 14 Apr 2021 03:53

i am trying to determine which user has a record locked in 'edit' mode.

In Rad Studio (Delphi) before i try and change a ROW value i use this code:

try
tCustomer.Edit;
except on E: EDAError do
begin
if e.ErrorCode = 1205 then Showmessage('Record in Use');
end;

This part works flawlessly as the TMyTable or TMyQuery returns the 1205 error code indicating the current record/row is locked by another user. But if that user has walked away from their desk to go to lunch or if they're on the phone i want the second user who needs to get access to the record to at least know WHICH user has the record locked.

Is something like this possible?

I know you can query CONNECTION_ID() or CURRENT_USER() but that is for the current client. I need a way to get at which CONNECTION_id or User OR wINDOWS LOGIN ACCOUNT is is.

Thanks in advance.

ViktorV
Devart Team
Posts: 3021
Joined: Wed 30 Jul 2014 07:16

Re: Is it possible to find out which user has a ROWLOCK on a table?

Post by ViktorV » Wed 14 Apr 2021 11:36

Your question relates to the server specifics rather than our components' functionality. You may consult the server's documentation, contact support, or search for an answer on specialized forums.

mjbcomp
Posts: 2
Joined: Wed 14 Apr 2021 03:45

Re: Is it possible to find out which user has a ROWLOCK on a table?

Post by mjbcomp » Wed 14 Apr 2021 23:33

Ok thank you.

ViktorV
Devart Team
Posts: 3021
Joined: Wed 30 Jul 2014 07:16

Re: Is it possible to find out which user has a ROWLOCK on a table?

Post by ViktorV » Fri 16 Apr 2021 08:10

Thank you for your interest in our products.
Feel free to contact us if you have any further questions about our products.

Post Reply