I have tested this and i got an error all the time or i get waiting for lock
depending on transaction settings.
I do the following:
CREATE TABLE A
(
ID BIGINT NOT null PRIMARY KEY
);
CREATE TABLE B
(
ID BIGINT NOT null PRIMARY KEY,
ID_A BIGINT NOT NULL
);
ALTER TABLE B ADD constraint FK_B__A FOREIGN KEY(ID_A) REFERENCES A(ID) ON
UPDATE CASCADE ON DELETE CASCADE;
tx1 starts (read commited)
tx1 INSERT INTO A (ID) VALUES (1);
tx2 starts (snapshot isolation)
tx1 commits
tx2 INSERT INTO B (ID, ID_A) VALUES (1, 1);
tx2 commits – i have an error here! violation of FOREIGN KEY constraint
"FK_B__A" on table "B" Foreign key reference target does not exist Problematic
key value is ("ID_A" = 1)
or transaction wait if i specifi wait for locks.
I have also create empty triggers but no change
I suppose you do someting different. Please describe exact steeps to reproduce
this.
Regards,
Karol Bieniaszewski
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel