Problem adding a foreign key
Posted in 2004
Topics: Error Codes & Troubleshooting, Server Administration, Triggers, Constraints & Referential Integrity, Transactions, Locking & Isolation, Platform-Specific Issues, Versions, Editions & End-of-Life
IDS 9.30HC5; HP-UX 11i
Not a problem, really, (I can kick the users off) but I can't
understand why issuing this:
set isolation to dirty read;alter table "dba".proj_request add constraint (foreign key
(cntrctid_ref)
references "dba".contract constraint "dba".proj_request_fk_02);
... produces this:
242: Could not open database table (dba.contract).
106: ISAM error: non-exclusive access.
I'm not DOING anything to the 'contract' table; and finderr for 106
says:
"The ISAM processor has been asked to add or drop an index but it does
not have exclusive access. ... For SQL products, the database server
returns this error when an exclusive lock is required on a table. For
example, this error appears when a second user tries to alter a table
that the first user has locked."
But AFAICS, the only table I'm altering is 'proj_request'.
Confused of Tunbridge Wells.
(Also posting to the ids list)
Malc P wrote:
> IDS 9.30HC5; HP-UX 11i
> Not a problem, really, (I can kick the users off) but I can't
> understand why issuing this:
>
> set isolation to dirty read;> alter table "dba".proj_request add constraint (foreign key
> (cntrctid_ref)
> references "dba".contract constraint "dba".proj_request_fk_02);
>
> ... produces this:
>
> 242: Could not open database table (dba.contract).
> 106: ISAM error: non-exclusive access.>
> I'm not DOING anything to the 'contract' table; and finderr for 106
> says:
>
> "The ISAM processor has been asked to add or drop an index but it does
> not have exclusive access. ... For SQL products, the database server
> returns this error when an exclusive lock is required on a table. For
> example, this error appears when a second user tries to alter a table
> that the first user has locked."
>
> But AFAICS, the only table I'm altering is 'proj_request'.
> Confused of Tunbridge Wells.
>
> (Also posting to the ids list)
Can you post the dbschema for the two tables?
You may have an issue with an existing index on contract (cntrctid_ref).