db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: Clarifications on fetch depth
Date Fri, 13 Jan 2006 22:51:38 GMT
Hi Alexander,

Thanks for your comments.

I'm persuaded by your argument that the use of fetch-depth is  
inappropriate for the simple purpose of limiting the depth of the  
fetch tree when recursion is not an issue.

I'll update the proposed final draft to reflect that the fetch-depth  
should be used to limit the recursion of the fetch graph.

Craig

On Dec 15, 2005, at 9:42 AM, Alexander Bieber wrote:

> Hi all,
>
> with a new version of JPOX I've noticed a change in the behaviour  
> concerning fetch-depth. After searching the archieves of this list  
> I believe to understand now that the intended use of fetch-depth is  
> to restrict the depth object graph of a field upon detaching.
> Nevertheless I see problems with that. Before the depth of the  
> field-based object-graph could be defined by the fetch-plan that a  
> user had set upon detaching. The only way of breaking this was by  
> the use of "self-referencing" fields. Doing so it was possible to  
> load large amounts of the datastore by simply detaching one object  
> with "unsuitable" fetch-groups. Using the fetch-depth attribute to  
> limit the graph depth of a detached field surely solves this  
> problem but also breaks some functionality.
> Imagine a PC A holding a list of PCs B that have members of a third  
> PC C. Now with the restriction on the depth of all fields when  
> detaching the list of the A a user would have to define different  
> fetch groups for A's list defining whether B's C member should be  
> included or not. Before this could be done by including a fetch  
> group for B's C in the fetch-plan or not.
> In my opinion also introduces some application design issues, as a  
> developer can not be sure that by defining a fetchgroup including a  
> field of an object this will be included upon detaching. It is no  
> longer possible (except with fetch-depth=0) to define "generic"  
> fetch-groups so the user can combine them to define what he wants  
> to retrieve, rather the developer has to define fetch-groups for  
> each possible usecase and might have to change the application- 
> backend for new frontends and usecases.
> In my oppinion it would be better to change the spec back to its  
> previous version, so that fetch-depth applies only to self- 
> referencing (=recursive) fields (direct _and_ indirect). A hard  
> limit could be set on detachCopy with an additional parameter  
> detachDepth that will apply to the object graph of the top-level  
> object that is detached.
>
> Any comments/replies are appreciated.
>
> Best regards Alexander Bieber
>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message