Discussion:
[firebird-support] Which connection causes object in use - is there a way to find that out?
Tomasz Tyrakowski t.tyrakowski@sol-system.pl [firebird-support]
2016-10-25 07:55:25 UTC
Permalink
Hi,

From time to time, when I try to alter a stored procedure in a
production database, I get "object in use" error. I was wandering, is
there a way to find the connections (users) that prevent a particular
procedure from being altered?
Querying MON$STATEMENTS is a no-go, no statement currently being
executed uses the procedure (directly) and yet an alter results in
"object in use".

thanks in advance
Tomasz
hvlad@users.sourceforge.net [firebird-support]
2016-10-25 08:20:02 UTC
Permalink
Post by Tomasz Tyrakowski ***@sol-system.pl [firebird-support]
From time to time, when I try to alter a stored procedure in a
production database, I get "object in use" error.
Run DDL statement in wait transaction. Better to set some timeout to not wait too much, but not no-wait mode
Post by Tomasz Tyrakowski ***@sol-system.pl [firebird-support]
I was wandering, is
there a way to find the connections (users) that prevent a particular
procedure from being altered?
No, sorry (one can use lock manager but it is not trivial)

Regards,
Vlad
Tomasz Tyrakowski t.tyrakowski@sol-system.pl [firebird-support]
2016-10-25 09:07:09 UTC
Permalink
Post by ***@users.sourceforge.net [firebird-support]
Post by Tomasz Tyrakowski ***@sol-system.pl [firebird-support]
From time to time, when I try to alter a stored procedure in a
production database, I get "object in use" error.
Run DDL statement in wait transaction. Better to set some timeout to not wait too much, but not no-wait mode
[...]
Post by ***@users.sourceforge.net [firebird-support]
No, sorry (one can use lock manager but it is not trivial)
Thanks Vlad. I'll play a bit with wait transactions and see if it helps
at least in some cases. At least I know there's no easy way which my
ignorance prevents me from seeing ;)

regards
Tomasz
rgilland1966@gmail.com [firebird-support]
2016-10-27 00:17:29 UTC
Permalink
This is something I asked several years ago, with no answer that I was happy with or could use. At least the exception should contain the connection IDs, holding the procedure in use.
Loading...