It looks like the problem is the join table.  Where does that sit?  I suspect 
that Propogate Primary Key is not going to work across databases.  You might 
have to manage that manually.

Chuck


On 2012-03-12, at 4:56 PM, Troy Lumasag wrote:

> Hello Alexis,
> 
> Thank you.
>> cross models flattened many-to-many relationships with differents users are 
>> buggy in my experience. 
>> You should use the same user in all your connection dictionnaries, easely 
>> done with Wonder in your Properties : 
> It needs to use different users :-P It looks like since the JDBC URL is the 
> same, WebObjects is assuming that the two databases are the same, even though 
> Oracle treats them differently since the user names are different.
>> At the db level you should make sure the "Oracle" user has the needed rights 
>> on "OracleConnect" user.
> I'll check if the needed rights are set.
>> Good luck
>> 
>> Alex
>> 
>> 2012/3/12 Fabian Peters <[email protected]>
>> Hello Troy,
>> 
>> Am 12.03.2012 um 10:58 schrieb Troy Lumasag:
>> 
>> 
>>> Hello everyone,
>>> 
>>> I'm new to Webobjects and Wonder and I enjoy it a lot. I'm having a simple 
>>> insert problem.
>> 
>> Welcome!
>> 
>>> My DB is Oracle and I have 2 Models(different User) .
>>> My EOModel would look like this:
>>> Model1
>>>      URL: jdbc:oracle:thin:@db.test:1521:oracletest
>>>      user:OracleConnect
>>> Model2
>>>      URL: jdbc:oracle:thin:@db.test:1521:oracletest
>>>      user:Oracle
>>> 
>>> Now I have a Many-To-Many Relationship Teacher(Model1) <-> Student(Model2).
>>> My Code would look like this:
>>> 
>>>     public void save() {
>>>         EOEditingContext ec = (ERXEC) ERXEC.newEditingContext();
>>> 
>>>         Teacher teacher = new Teacher();
>>>         ec.insertObject(teacher);
>>> 
>>>         teacher.setName(teacherName);
>>> 
>>>         Student student1 = new Student();
>>>         Student student2 = new Student();
>>>         ec.insertObject(student1);
>>>         ec.insertObject(student2);
>>> 
>>>         student1.setName(studentName1);
>>>         student2.setName(studentName2);
>>> 
>>>         teacher.addToStudentsRelationship(student1);
>>>         teacher.addToStudentsRelationship(student2);
>>> 
>>>         ec.saveChanges();
>>>     }
>>> 
>>> I got this NPE everytime:
>>> 
>>> NullPointerException
>>>   at 
>>> com.webobjects.eoaccess.EODatabaseContext.primaryKeyForIntermediateRowFromSourceObject(EODatabaseContext.java:4845)
>>>   at 
>>> com.webobjects.eocontrol.EOObjectStoreCoordinator.saveChangesInEditingContext(EOObjectStoreCoordinator.java:373)
>>>   at 
>>> com.webobjects.eocontrol.EOEditingContext.saveChanges(EOEditingContext.java:3192)
>>>   at er.extensions.eof.ERXEC._saveChanges(ERXEC.java:1094)
>>>   at er.extensions.eof.ERXEC.saveChanges(ERXEC.java:1016)
>>>   at your.app.components.Main.save(Main.java:67) 
>> 
>> I've never used Oracle but the problem seems to be related to PK generation. 
>> I guess the first thing to check would be whether you set the 
>> "OraclePlugIn". You can set it in entity modeler (just put  "OraclePlugIn" 
>> where I have "PostgresqlPlugIn"):
>> 
>> <Mail Attachment.png> 
>> 
>> cheers, Fabian
>> 
>> 
>>> Looks pretty simple but I'm stuck. Thank you in advance!
>>> 
>>> Regards,
>>> Troy
>>> 
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list      ([email protected])
>>> Help/Unsubscribe/Update your Subscription:
>>> https://lists.apple.com/mailman/options/webobjects-dev/lists.fabian%40e-lumo.com
>>> 
>>> This email sent to [email protected]
>> 
>> 
>>  _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list      ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/alexis.tual%40gmail.com
>> 
>> This email sent to [email protected]
>> 
>> 
>> 
>> 
>>  _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list      (
>> [email protected]
>> )
>> Help/Unsubscribe/Update your Subscription:
>> 
>> https://lists.apple.com/mailman/options/webobjects-dev/tlumasag%40gmail.com
>> 
>> 
>> This email sent to 
>> [email protected]
> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/chill%40global-village.net
> 
> This email sent to [email protected]

-- 
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall 
knowledge of WebObjects or who are trying to solve specific problems.    
http://www.global-village.net/gvc/practical_webobjects








Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to