Board index » delphi » object is in use error while adding foreign key

object is in use error while adding foreign key

Hi all,

I am trying to create a new table through my application and add a foreign
key reference to
an existing table.

I am getting the error - metadata update unsuccessful - objet
[existing_table_name] in use.

Can anyone tell me whats happening here , please?

None of the other connections are being used to query/or update the existing
table!!
However if I shut down my application and try to do the same through the
isql window, it works fine...

Thanks in advance !
amrita .

 

Re:object is in use error while adding foreign key


Somewhere in yoru app you have an open cursor on the existing table. Perhaps one
of your query objects was left in an active state. Check any and all forms that
can possibly be created at the point that this error occurs. Something has a
link to that table.

Allen.

Quote
Mahajan wrote:
> Hi all,

> I am trying to create a new table through my application and add a foreign
> key reference to
> an existing table.

> I am getting the error - metadata update unsuccessful - objet
> [existing_table_name] in use.

> Can anyone tell me whats happening here , please?

> None of the other connections are being used to query/or update the existing
> table!!
> However if I shut down my application and try to do the same through the
> isql window, it works fine...

> Thanks in advance !
> amrita .

Re:object is in use error while adding foreign key


I absolutely made sure thats not the case !!
:(

No, when the application comes up,
first, I make 4 connections for the DB pool,
second, (as part of init) I create/alter some stored procedures that do not
refer to the existing table in any way and
then try I to add this new table and set up reference to an exisitng table
through the application, and
I get the message that the existing table I am trying to refer to is in use.

Do I have to lock the DB in some way in order to be able to to the meta-data
update ?

regards,
AM

"G. Allen Casteran" <al...@nisnic.com> wrote in message
news:3D495DE7.BFF5E6D4@nisnic.com...

Quote
> Somewhere in yoru app you have an open cursor on the existing table.
Perhaps one
> of your query objects was left in an active state. Check any and all forms
that
> can possibly be created at the point that this error occurs. Something has
a
> link to that table.

> Allen.

> Mahajan wrote:

> > Hi all,

> > I am trying to create a new table through my application and add a
foreign
> > key reference to
> > an existing table.

> > I am getting the error - metadata update unsuccessful - objet
> > [existing_table_name] in use.

> > Can anyone tell me whats happening here , please?

> > None of the other connections are being used to query/or update the
existing
> > table!!
> > However if I shut down my application and try to do the same through the
> > isql window, it works fine...

> > Thanks in advance !
> > amrita .

Re:object is in use error while adding foreign key


In article <3d4952bb$1_1@dnews>, achau...@sta.samsung.com says...
Quote
> I am trying to create a new table through my application and add a foreign
> key reference to
> an existing table.

> I am getting the error - metadata update unsuccessful - objet
> [existing_table_name] in use.

> Can anyone tell me whats happening here , please?

        Yes, you must be the only connection to the DB to add a FK.  You
can't even have multiple connections from a single machine.

        HTH,

        -Craig

--
 Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
     Delphi/InterBase WebLog: http://delphi.weblogs.com
     InterBase PLANalyzer (Free IB optimization tool):
          http://delphi.weblogs.com/IBPLANalyzer

Other Threads