Subject RE: [firebird-support] Foreign keys
Author Alan McDonald
> > in your wizard... your application starts, and recognises that the
> > firebird
> > database does not exist so it needs to make one.
> > It runs a script (including definitions of foreign keys).
>
> No it runs no script and yes the connection pool is active, since the
> database exists, but not the structure.
>
> > If you issue the COMMIT; at appropriate places in this script, you
> > will not
> > get any errors raised. after all, this is exactly what gbak has to do
> > during
> > a restore, it constructs the db with foreign keys then puts the data
> > into to
> > it.
>
> I'm using autocommit in Java for issuing all this anyway, so everything
> is always committed. Anyway, Firebird doesn't seem to isolate metadata
> changes in transactions. They seem to 'bleed through'.

there are some real differences, here, using java for this purpose. The
jbird driver does not always behave as we are used to it in non java
connections. You are best advised to ask on the java forum for more info
here.

>
> > Also, at this point, connection pooling cannot be active since the db
> > does
> > not exist. So why is connection pooling in the mix here at all?
>
> The database does exist, the structure is created automatically.

there database only exists in name.. no connections can do anything to it
other than create metadata structure.
I don't think that pooling is the issue here at all.

>
> > Your problem is only evident, it would seem, not during db creation,
> > but
> > under normal load and when you want to effect further metadata changes.
> > There has been a million and one discussions on this - save us
> > regurgitating
> > it all and search the www.ibphoenix.com website knowledge base for all
> > the
> > information you need on this subject.
>
> I searched the mailinglists and could only find a few, without any real
> discussion. Just 'you should to this with only one connection active or
> reset all your connections'.
>

try searching all of helen borrie's entries on foreign keys - you'll get
more than you have time to read.

> http://www.google.com/search?q=site%3Awww.ibphoenix.com+foreign+key
>
> I'm very interested to know where you found million and one
> discussions, and if they are there maybe they indicate a real demand.
>
> --

Alan