Subject | Re: problem with foreign keys |
---|---|
Author | Alexander V.Nevsky |
Post date | 2004-05-05T18:17:30Z |
--- In firebird-support@yahoogroups.com, "Rodrigo Bravo"
<rodrigobravo@v...> wrote:
- answer is obvious, there is'nt parent record for record inserted
into TABLEB. If yes - this is transactions control and isolation level
question. If parent record inserted but not commited, TransactionB
will not see it in any case. If it is commited but TransactionB have
concurrency isolation level and commit of parent record was performed
after start of TransactionB, it will never see this record.
Best regards,
Alexander
<rodrigobravo@v...> wrote:
> Hi,TABLEA.ID
> I've a problem with Firebird 1.5 Final Release:
> PREVIOUS STATUS:
> TABLEA:
> ------------------------
> ID | DESCRIPTION
> ------------------------
>
> TABLEB:
> ----------------------------------
> ID | ID_FK | DESCRIPTION
> -----------------------------------
> Important: On TABLEB exists a Foreign Key, between TABLEB.ID_FK and
>successful
> STEP 1 on TransactionA:
> Execute the sql: "SELECT * FROM TABLEA WHERE A_ID = 1"
>
> STEP 2 on TransactionB:
> Execute the sql: "INSERT INTO TABLEB (ID, ID_FK, DESCRIPTION) VALUES (1,
> 1, "Hello")"
>
> And the last command returns this error:
> Unsuccessful execution caused by system error that does not preclude
> execution of subsequent statements lock conflict on no wait transaction.Many reasons. Firstly, does STEP 1 returned row from TABLEA? If not
> violation of FOREIGN KEY constraint "FK_XXXX" on table "TABLEB"
>
> Does anyone knows why I can't insert the last record?
- answer is obvious, there is'nt parent record for record inserted
into TABLEB. If yes - this is transactions control and isolation level
question. If parent record inserted but not commited, TransactionB
will not see it in any case. If it is commited but TransactionB have
concurrency isolation level and commit of parent record was performed
after start of TransactionB, it will never see this record.
Best regards,
Alexander