forcedotcom/java-sdk — Issue #12: Objects loaded from queries don't always connect properly to their related objects
Author: davidbuccola
Created: 2011-11-15 14:30:55+00:00
State: open

I encountered a problem with the Force JPA and I was hoping to talk to you at some point about it. I’ve tried to reproduce with a small program but have been unsuccessful. I can easily reproduce in my larger program. I thought maybe you or someone might have some ideas if you see the bug in action.

The problem is this:

I’ve got a tree of related objects. When I load the object with a “em.find” everything is built okay. If I load the object with a query instead then the object tree is not built okay. The “DEBUG” statements show the SOQL asking for all the information to build the tree but the tree doesn’t get built completely in the query case. The hierarchy looks something like this:

Subscription -> Application -> Vendor

When I query for Subscription the “Subscription -> Application” link comes out okay but the “Application -> Vendor” link is missing.

If I do “em.refresh(subscription)” after the query then the tree is built correctly. Naturally this is a performance problem so I prefer not to refresh each result of the query every time.

Do you have any ideas of how to proceed? Again, I have been unsuccessful in reproducing in a small program.