Apache JDO Project - Re: JDO2 §12.7.2: fetch-depth only

This is Interesting: Free IT Magazines  
Home > Archive > Apache JDO Project > September 2005 > Re: JDO2 §12.7.2: fetch-depth only





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: JDO2 §12.7.2: fetch-depth only
Michael Bouschen

2005-09-26, 7:45 am

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

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com