2012/3/13 Troy Lumasag <[email protected]> > 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 > Yes you can use different users to organize your data, but WO should use only one user to connect
> 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. > In fact it's the opposite, WebObjects creates one db connection per distinct connection dictionnary, in your case the user name differs so it creates 2 db connections. The Wonder properties overrides all the connection dictionnaries so your app will use only one connection. > 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. > In the eomodel you must alseo prefix the table names by the user. (ie : OracleConnect.TEACHER, Oracle.STUDENT) Alex > 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"): >> >> >> >> 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/alexis.tual%40gmail.com > > This email sent to [email protected] > >
<<image/png>>
_______________________________________________ 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]
