Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Override EAGER Fetch Relationships for a query

James, Thanks for your reply.


James Sutherland wrote:
> 
> You do not need to implement anything special for FetchGroups, you just
> need to enable weaving.
> 
If memory serves, I was getting an exception concerning lack of a
FetchGroupManager.  I'm still learning and need to do some more
investigation.


James Sutherland wrote:
> 
> The session in the Entity is transient, so does not give any remote client
> access to anything.  On the server any server code can access your
> EntityManager or DataSource directly, so I'm not sure what security you
> think you have.
> 

As I investigated further, I did see in the debugger that calls from the
client to '_persistence_getSession() ' consistently returned null.  Just got
scared when I saw the method signature.  Also noticed the method appears on
statically woven entities regardless of whether they implemented
FetchGroupTracker.


James Sutherland wrote:
> 
> If you normally want 0, then just make your relationships LAZY, and that
> is what you will get.  In the places you need the relationship
> instantiated you can either join fetch the relationship, or access the
> relationship after the query to ensure it is instantiated.
> 

EAGER is required for the vast majority of our EJB methods, perhaps 90%, and
it works perfectly under namedQuery, ad-hoc query strings and em.find(). 
Just looking to optimize the 10%, which is where our listForDepth(...)
method came from originally.

The benefits of the CriteriaAPI implementation is well worth a handful of
potential 'un-necessary' trips to the DB!

Thanks again for your help.

Jim 
-- 
View this message in context: http://old.nabble.com/Override-EAGER-Fetch-Relationships-for-a-query-tp28496997p28529533.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top