Subject Re: [firebird-support] Re: problem adding foreign key
Author Ann W. Harrison
markd_mms wrote:

>
> anyway i restarted the server and
> tried it again and it worked ok. maybe a transaction hadn't been
> committed (or rolled back)?
>

Firebird checks the use count on tables involved in new foreign key
constraints. You can't define a constraint if any existing connection
has used the table - including your own. Prepared statements belong to
the connection - they're not released on a commit. Using an old
prepared statement on a table that has become subject to a foreign key
constraints would allow bad data to be entered - the old prepared
request doesn't know about the new constraint.

Regards,


Ann