Subject | Re: Automatically remove unused PK's from second table?? |
---|---|
Author | prokhorovav |
Post date | 2002-06-10T04:33Z |
--- In ib-support@y..., "csswa" <csswa@y...> wrote:
user #1
start transaction
delete from t_person
where condition
-- and trigger for delete
-- will delete record from t_car
User #2
start transaction
insert into t_person(..) values (..)
-- for existing record from t_car
user #1
commit
User #2
commit
What happen in this case?
You will get error:
Violation of FOREIGN KEY constraint "FK_T_EMP_CAR" on table T_Person
The user #2 will be very much surprised, when adding record in
t_person for an existing foreign key in t_car he has received the
message that this foreign key does not exist.
Best regards
Andrey Prokhorov
> Why? Doesn't the MGA of FB catch any conflict? Can you elaborateon
> this warning?For example
user #1
start transaction
delete from t_person
where condition
-- and trigger for delete
-- will delete record from t_car
User #2
start transaction
insert into t_person(..) values (..)
-- for existing record from t_car
user #1
commit
User #2
commit
What happen in this case?
You will get error:
Violation of FOREIGN KEY constraint "FK_T_EMP_CAR" on table T_Person
The user #2 will be very much surprised, when adding record in
t_person for an existing foreign key in t_car he has received the
message that this foreign key does not exist.
Best regards
Andrey Prokhorov