Some more informations:

I checked if the two Entities have the same external type, they have.

Then I readed this
http://lists.apple.com/archives/webobjects-dev/2008/Nov/msg00571.html

I get the following output
context from model of parententity:
com.webobjects.eoaccess.EODatabaseContext@7a4fe91e
context from model of subentity:
com.webobjects.eoaccess.EODatabaseContext@1f3a34af
Same?
Not same context.

So there  are not the same context objects. Chuck said in the other thread,
that this may cause the problem.
So how can I make my application use the same EODatabaseContext-Objects for
the two different models. Or is it correct, that there are two different
objects, because the models use different databases?



2013/11/20 Comm unity <[email protected]>

> Thanks guys. Yesterday I found the same information in a short note inside
> the EOModeler documentation (
> https://developer.apple.com/legacy/library/documentation/WebObjects/UsingEOModeler/Introduction/Introduction.html#//apple_ref/doc/uid/TP30001018-CH201-TP1
> )
>
> So I tried a different approach. The two entities are now not modeled in a
> hierachy, but lets use anyway the words Parententity and Subentity. Again:
> Parententity is in database1 and Subentity in database2
>
> I created a to one relation from Subentity to Parententity. Note: The
> relation is only UNIDIRECTIONAL, from Subentity to Parententity.
> Then I want to implement methods which give acces to the attributes from
> the Parententity so the pseudo Subentity "feels like" a true Subentity. I
> must implement these methods, because flatten attributes also don't work
> across different databases.
>
> But now I get the following exception:
>
> The object with globalID _EOIntegralKeyGlobalID[<Parententity>
> (java.lang.Long)11816] could not be found in the database. This could be
> result of a referential integrity problem with the database. An empty fault
> could not be created because the object's class could not be determined
> (e.g. the GID is temporary or it is for an abstract entity).
>
> This entity exists in the database. I don't know what I do wrong....
>
>
> 2013/11/19 David Avendasora <[email protected]>
>
>> Chuck is, of course, correct. From the classic, 2007 best-seller
>> "WebObjects Enterprise Objects Programming Guide”:
>>
>> <quote>
>> There are, however, a few limitations when using multiple data sources in
>> an application. They include:
>>
>>         • Within an EOModelGroup, all entity names must be unique.
>> ->      • You can’t model inheritance hierarchies across different data
>> sources.
>>         • Australia is entirely peopled with criminals
>>         • You can’t flatten attributes or relationships across data
>> sources.
>>         • Never get involved in a land war in Asia
>>         • Enterprise Objects doesn’t support two-phase commit, so you
>> have to be careful when a saving enterprise objects that are constituted
>> from different data sources in a single invocation of
>> EOEditingContext.saveChanges().
>> </quote>
>>
>> Don’t go getting mad at me. That’s just what it says.
>>
>> Dave
>>
>>
>> On Nov 19, 2013, at 1:22 PM, Chuck Hill <[email protected]> wrote:
>>
>> > "cannot do a deep fetch on entity … with parent … because they are
>> stored in different databases."
>> >
>> > IIRC EOF does not support inheritance across databases.
>> >
>> > Chuck
>> >
>> > --
>> > Chuck Hill
>> > Executive Managing Partner, VP Development and Technical Services
>> >
>> > 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
>> >
>> > Global Village Consulting ranks 13th in 2012 in BIV's Top 100 Fastest
>> Growing Companies in B.C!
>> >
>> > Global Village Consulting ranks 44th in 25th annual PROFIT 500 ranking
>> of Canada’s Fastest-Growing Companies by PROFIT Magazine!
>> >
>> > On 2013-11-19 6:01 AM, "Comm unity" wrote:
>> >
>> > Hey guys,
>> > I try to model an inheritance between two different models and two
>> databases.
>> >
>> > I have the parent entity modeled in "model1" and stored in "database1"
>> and the subentity in "model2" and "database2".
>> >
>> > The subentity has additional attributes and additional relations.
>> >
>> > Now, when I try to run the application, the following exception appears:
>> >
>> > IllegalArgumentException: _buildNodeListWithParent: cannot do a deep
>> fetch on entity '<SubEntity>' with parent '<ParentEntity>' because they are
>> stored in different databases.
>> >
>> > Where <SubEntity> is the name of the subentity and <ParentEntity> the
>> name of the parententity.
>> >
>> > Does anybody have an idea?
>> >
>> > Thanks.
>> >
>> > _______________________________________________
>> > 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/webobjects%40avendasora.com
>> >
>> > This email sent to [email protected]
>>
>>
>> —————————————————————————————
>> WebObjects - so easy that even Dave Avendasora can do it!™
>> —————————————————————————————
>> David Avendasora
>> Senior Software Abuser
>> Nekesto, Inc.
>>
>>
>>
>>
>>
>>
 _______________________________________________
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