• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Fetching objects with relationship to an abstract entity does many db roundtrips
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fetching objects with relationship to an abstract entity does many db roundtrips


  • Subject: Re: Fetching objects with relationship to an abstract entity does many db roundtrips
  • From: Mike Schrag <email@hidden>
  • Date: Wed, 11 Nov 2009 09:26:03 -0500

EOF can't create faults for to-one relationships to abstract entities, because a fault object has to be the correct java type, which requires fetching the object to determine which restricting qualifier matches it.

ms

On Nov 11, 2009, at 8:16 AM, Sobanski, Jedrzej wrote:

Hi,

I have a performance issue when it comes to initializing object having
relationship referring to abstract entity. My model is like:
- non-abstract entity "Referring" which foreign key "referredId" and
relationship on it, pointing to Referred.referredId
- abstract entity "Referred" with primary key "referredId" and a field
named "type"
- non-abstract entity "ReferredA" extending "Referred". There's type
qualifier on field "type"
- non-abstract entity "ReferredB" extending "Referred". There's type
qualifier on field "type"
- non-abstract entity "ReferredC" extending "Referred". There's type
qualifier on field "type"

When I fetch a bunch of Referring (let's say 70 rows) then I see in
logs "70 row(s) processed" but right after it in logs, while still in
the same EOEditingContext#objectsWithFetchSpecification
(EOFetchSpecification), it does 70 more fetches, where each of them is
like:
"... expression took XX ms: SELECT ... FROM Referred WHERE ... AND
referredId = <some concrete id>
fetch cancelled
1 row(s) processed"

So in total it does 71 database roundtrips. It looks like it fetches
full objects for Referring.referred relationship instead of just
creating fault. I believe it's because relationship points to abstract
entity and having only referredId from Referring, still doesn't
specify final entity for target object. So I think what EOF does it
fetches full target object, to check value for field "type" to fully
determine target entity.

Do you know if and how can I avoid this resource consuming routine?

--
Regards,
Jedrzej Sobanski

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Fetching objects with relationship to an abstract entity does many db roundtrips (From: "Sobanski, Jedrzej" <email@hidden>)

  • Prev by Date: Re: UTF8 and ContentEncoding
  • Next by Date: Re: Can't retrieve cookies (closer, but not there yet)
  • Previous by thread: Fetching objects with relationship to an abstract entity does many db roundtrips
  • Next by thread: Postponed validation possible?
  • Index(es):
    • Date
    • Thread