Subject Re: Self Reference Error? Bug? Still Getting it
Author dcabbar
Actually, I was connected to the database from an EMS IB Manager
client while trying to execute this. When I closed the IB Manager
client and tried it again, it worked.

So, if you have a jdbc connection pool, and try to create the foreign
key from a jdbc connection, does this mean it will fail if there are
other open jdbc connections? Is there any workaround or planned
further fixes for this?

Thanks for the help...

--- In firebird-support@yahoogroups.com, "Thomas Steinmaurer"
<ts@i...> wrote:
> > Ok, this is kind of weird, but I am using Firebird 1.5 Release
> > Candidate 8, and still getting the error for any relation now!
> >
> > my SQL File:
> > ----------------------
> > connect 'dbserver/3050:D:\DB\DBDataFile.gdb' user 'sysdba' password
> > 'masterkey';
> >
> > create table ExampleTable (
> > code integer not null primary key,
> > name varchar(100) not null unique,
> > parent integer);
> > commit;
> >
> > alter table ExampleTable
> > add constraint fk_parent
> > foreign key (parent) references ExampleTable(code);
> >
> > commit;
> > ----------------------
> > I execute this using isql, and still getting the error:
> >
> > isql -i c:\temp\aa.sql
> > Use CONNECT or CREATE DATABASE to specify a database
> > Statement failed, SQLCODE = -607
> >
> > unsuccessful metadata update
> > -object EXAMPLETABLE is in use
> >
> > Any idea what is going on? Is this a DB config param? Or is my db
> > instance messed up?
>
> There were some improvements in the "object ... is in use" area
> in Firebird 1.5, but you still need to be the only one connected
> to the database when creating FOREIGNKEY Constraints. So, are
> there any other active connections available?
>
>
> Best Regards,
> Thomas Steinmaurer
>
> Logging/Auditing Suite for InterBase and Firebird
> http://www.iblogmanager.com
> Logging/Auditing Suite for Advantage Database Server
> http://www.adslogmanager.com