db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Bouschen <mbo.t...@spree.de>
Subject Re: JDO2 §12.7.2: fetch-depth only for "recursive fetch group references"?
Date Mon, 26 Sep 2005 12:12:33 GMT
Hi Jörg,

my $0.02:
I read the spec that a self-referencing relationship (meaning the field 
type is the same class that declares the field) is a good use case for 
the fetch-depth attribute. But I think the use of fetch-depth is not 
restricted to self-referencing relationships. Am I wrong here?

Regards Michael

> 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
> 


-- 
Michael Bouschen		Tech@Spree Engineering GmbH
mailto:mbo.tech@spree.de	http://www.tech.spree.de/
Tel.:++49/30/235 520-33		Buelowstr. 66			
Fax.:++49/30/2175 2012		D-10783 Berlin			

Mime
View raw message