Subject RE: [firebird-support] Table is in use
Author Helen Borrie
At 02:24 PM 15/12/2004 -0500, you wrote:

>:: You must have an exclusive connection to a database to add
>
>How do I obtain an exclusive connection?

If you're in an environment where you don't have any control over people
logging in and out, you'll need to use gfix to perform a database shutdown.


>:: or change foreign keys. Additionally, if you're using a
>:: tool that has the table open (even if you are the only one
>:: connected) then it's in use.
>
>When I try and make this change - Im the only one connected. The DB however
>says it has like 45 other connections - but no apps are open that are still
>using FB. Left over connection pool connetions or something? Is there anyway
>to determine who/what it is? Right now I have to just reset the server....

Well, that's one way. I guess if you are pooling connections, you'll have
to do whatever it takes to drop them, in order to add or alter foreign key
constraints.


>:: >I thought so - but in this last case the table (Country) it
>:: said was in
>:: >use, is NEVER written to. Its static data that is only read from.
>::
>:: It doesn't have to be written to, to be in use. If it's
>:: open, it's in a transaction and, if it's in a transaction,
>:: it's in use.
>
>Where would these transactinos be if no apps are connected to the db at the
>time? Could there be abandoned but open txs somehow?

If you are talking about adding or modifying foreign keys, then there must
be no other *attachments* concurrent with the one that is trying to do that
task. A FK is a global constraint, inasmuch as it has flow-on effects on
one or more other tables. The user doing the task has to be either SYSDBA
or the database owner. If it is the database owner, it also requires SQL
permissions on all of the tables affected by the constraint.

./heLen