Subject Re: [firebird-support] Determining what user has a lock on a table?
Author Hardee Mahoney
Thank you Helen for your response.

I apologize for my question being so vague, but I was trying not to violate
the rules of this list against being too application development platform
specific. The database control referred to is a special control which reads
and writes to a Firebird database from a Delphi application. When its
lockmode property is set to Immediate, if one user has a row in a table
"selected" another user can't edit it. A message is generated which I can
trap. It's not the whole table, just the row.

I thought that if the control was calling some Firebird Select or Update
statement (like you mention below) under the covers, which I think it must
be doing, then it might be possible to query a system table to see if a user
had a lock on that table and maybe even get the user's user name. I looked
at the system tables but didn't see anything that might have that
information.

But I don't really know what the control is doing (I don't have the source
code), so if my question does not have enough to go on in order to give an
answer to it, I understand. Also, it could be the control is somehow
maintaining its own lock mechanism on top of Firebird, I really can't say.

Thanks again.


On Tue, Nov 4, 2008 at 8:28 PM, Helen Borrie <helebor@...> wrote:

> At 03:02 AM 5/11/2008, you wrote:
> >Hello,
> >
> >I have an application where the database control holds an immediate lock
> >(pessimistic lock) on a row when that row is being edited. Is there a way,
> >by reading the system tables, to determine what user has a lock on that
> >table at that time?
>
> What are you talking about here? A pess. lock on a ROW by some means such
> as a dummy update? or one affecting a whole table such as (shudder) SELECT *
> FROM ATABLE FOR UPDATE WITH LOCK? or a transaction with a RESERVING clause
> on that table?
>
> What do you mean by "the database control"?
>
> ./heLen
>
>
>


[Non-text portions of this message have been removed]