Subject | Foreign key problem |
---|---|
Author | Ivan Prenosil |
Post date | 2007-01-18T00:32:16Z |
When one transaction locks (updates) row in Master table,
then other transactions
- can Update related rows in Detail table, but
- can't Insert new Detail rows (referencing pk of locked row)
Why ?
The error message is also peculiar:
Statement failed, SQLCODE = -901
lock conflict on no wait transaction
-violation of FOREIGN KEY constraint "INTEG_3" on table "DETAIL"
-Foreign key reference target does not exist
The master row existed(was committed) before these transactions
started, so the row/pk is normally visible.
Ivan
then other transactions
- can Update related rows in Detail table, but
- can't Insert new Detail rows (referencing pk of locked row)
Why ?
The error message is also peculiar:
Statement failed, SQLCODE = -901
lock conflict on no wait transaction
-violation of FOREIGN KEY constraint "INTEG_3" on table "DETAIL"
-Foreign key reference target does not exist
The master row existed(was committed) before these transactions
started, so the row/pk is normally visible.
Ivan