db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Bieber <a...@nightlabs.de>
Subject Clarifications on fetch depth
Date Thu, 15 Dec 2005 17:42:37 GMT
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


Mime
View raw message