[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with Oracle 7.3 and WO3.5.1



You need to read about modeling Many-to-Many relationships in the EOF
Guide. This is so much easier than you are making it.  You should not
even have to touch the Join table. With proper EOModel set up, you can
add and remove objects from an array in either the A or B and EOF will
automatically insert/delete the records for you in the join the table.  

Note there is menu option in EOModeler called 'Join Many to Many' that
sets up this type of modeling for you.

d

METRiX Support wrote:
> 
> I have a problem with a WO3.5.1 application running against an Oracle 7.3
> database.
> 
> I have 3 important tables in Oracle being administrated by my WebObjects
> application. (Table A) and (Table B) contain data and (Table C) is a join
> table allowing Many-To-Many relationships between (Table A) and (Table B).
> 
> I can insert and delete records from (Table A).
> I can insert and delete records from (Table B).
> I can delete records from (Table C).
> I cannot, however, insert "join" records into (TABLE C).
> 
> Instead of inserting a record into the join table (Table C) I receive this
> error:
> _primaryKeyForObject:: EODatabaseContext 0x5be890 is unable to obtain a
> primary
>                    key for InvestigatorSite object 0x6169b0
> 
> I am wondering:
>  what to do to fix the problem,
> interpretations of what might be causing this problem,
> and strategies for avoiding it in the future.
> 
> Thanks in advance for your help,
> DB
> 
> --------------------------------
> METRiX Technologies Support Desk
> WebObjects Applications
> 301-977-9553 Ext. 15