Subject Foreign keys
Author Geert Bevin

I'm trying to create foreign keys during the definition of a table, for
instance like this:
create table car (id INT NOT NULL PRIMARY KEY, name varchar(10));
create table person (id INT NOT NULL PRIMARY KEY, carid INTEGER,
FOREIGN KEY (carid) REFERENCES car (id));

I get the following error message if I'm not the only one connected to
the database:
Statement failed, SQLCODE = -607
unsuccessful metadata update
-object CAR is in use

I read in a earlier message that was posted to the list that you
consider this 'normal' and that one should ensure that all the
connections are restarted in between or that you are the only one
connected to the database.

Sadly for me this is not an option and I honestly think this is very
weird behavior. I create the database structure at the start of a web
application. The connection pool is setup first and people can choose
between the support database servers (I'm working on Firebird support
now, it already does PostgreSQL, MySQL, Oracle, HypersonicSQL). Then
the setup wizard starts and creates the whole structure automatically.
Unless I shift my application completely around (and I'm pretty sure
many people structure it like that), there's no way that I can reserve
things in one connection. Isn't there some option that I can use to
make these metadata updates be executed in isolation from others
(transactions don't seem to isolate these)?

Thanks for the help,


Geert Bevin Uwyn bvba
"Use what you need" Avenue de Scailmont 34 7170 Manage
gbevin[remove] at uwyn dot com Tel +32 64 84 80 03

PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9
Public PGP key : available at servers,