db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jörg von Frantzius <joerg.von.frantz...@artnology.com>
Subject JDO2 §12.7.2: fetch-depth only for "recursive fetch group references"?
Date Mon, 26 Sep 2005 09:47:28 GMT
Hi,

In §12.7.2 of the spec, it reads

    "Recursive fetch group references are controlled by the fetch-depth
    attribute."

In the corresponding examples in the spec, any field annotated with 
"fetch-depth" refers to the same class that declares the annotated 
field. So it seems the use of fetch-depth should be limited to recursive 
fields (i.e. fields referencing the same class as the declaring class, 
as I understand it).

Now I wonder what sense that makes e.g. for detaching. Depending on the 
structure of the object model, e.g. in the presence of bidirectional 
associations, detaching a single object will easily lead to the whole 
database or large parts of it being detached. That's probably not wanted 
in most cases where the database is not completely kept in RAM anyway. 
Imagine e.g. class Department and Employee with a bidirectional 1:m 
association Department<->Employee: detaching one Employee object will 
detach all other Employees of the same department.

In my original submission of fetch-depth for detaching in JPOX, 
fetch-depth is obeyed for any kind of reference. I'm using this to 
generically replicate one database onto another. That makes it possible 
to e.g. replicate an MSSQL server onto a client-side Derby instance 
ready for offline-access. This replication mechanism isn't usable with 
fetch-depth being applicable only to recursive fields, and that's 
unfortunately what JPOX does now in accordance with the spec.

It would be nice if you (Craig?) could clarify whether fetch-depth 
really should be limited to recursive fields only. If I'm not mistaken 
entirely, that means generic replication using detach/attach is made 
unusable in many cases unless e.g. you maintain your own version of JPOX.

Thanks,
Jörg



Mime
View raw message