Apache JDO Project - Fetch groups and EJB3

This is Interesting: Free IT Magazines  
Home > Archive > Apache JDO Project > August 2005 > Fetch groups and EJB3





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 Fetch groups and EJB3
Jörg von Frantzius

2005-08-08, 7:45 am

Hi,

there is a public discussion with low noise and interesting participants
going on over at news://news.eclipse.org/eclipse.technology.ejb-orm and
news://news.eclipse.org/eclipse.technology.jsr220-orm (account required
<http://www.eclipse.org/newsgroups/index.html> on eclipse.org), about
the concept of fetch groups and reasons for it's rejection in EJB3. The
case of my lonely battle there is both supporting an Eclipse ORM project
that also supports JDO2, and a possible inclusion of fetch groups in EJB3.

You may find some of my arguments there silly, but I thought the
discussion as such is interesting enough to bother you with this note.
Things are openly discussed there, as opposed to closed EJB3 expert
group circles that seem potentially dominated by marketing rationale
rather than technical reason.

While e.g. Mike Keith of Oracle finds fetch groups not worth the hassle,
I do think they are worth it, as they shield me as an OO programmer from
details of relational joins. Mike Keith also gives reasons why fetch
groups have been rejected in the EJB3 expert group (performance
advantages only in rare cases).

If fetch groups would make it into the EJB3 spec either in a future
version or a as an optional feature, I imagine that could give JDO2
vendors that support EJB3 a competitive advantage. It wouldn't hurt if
there were more voices saying in that forum that the more transparent
persistence in a relational store is, the better it is for a good object
oriented design. Or whatever you think is an advantage of fetch groups

Thanks for your attention and sorry for the intrusion,
Jörg.

--
________________________________________
__________________
Dipl.-Inf. Jörg von Frantzius | artnology GmbH
| Milastr. 4
Tel +49 (0)30 4435 099 26 | 10437 Berlin
Fax +49 (0)30 4435 099 99 | http://www.artnology.com
_______________________________|________
__________________


Niclas Hedhman

2005-08-08, 7:45 am

On Monday 08 August 2005 17:48, J=F6rg von Frantzius wrote:
> concept of fetch groups


Do you have some definition for what the meaning of "fetch groups" are for =
us=20
who have no clue ???


Cheers
Niclas

Jörg von Frantzius

2005-08-08, 5:45 pm

Niclas Hedhman schrieb:

>On Monday 08 August 2005 17:48, Jörg von Frantzius wrote:
>
>
>
>Do you have some definition for what the meaning of "fetch groups" are for us
>who have no clue ???
>
>

It's part of the JDO specification, and it allows you to statically
declare groups of fields on classes and then dynamically combine these
groups to specify which fields of a class you want to have fetched from
the DB when using a Query or retrieving via a PersistenceManager directly.

You can e.g. chose the predefined FetchPlan.EMPTY on a Query to have
"shallow" objects, which will effectively only retrieve the ids. Any
access on non-loaded fields will transparently result in lazy-loading of
the values.

If e.g. in a GUI table you show only a subset of the fields of a class,
and you otherwise don't need the values of the fields not displayed, you
could define a fetch group "guiTable" that includes only those fields.
Saves you both a little loading time and memory.

While the default fetch group only includes primitive values, you can
define a fetch group that includes complex fields, i.e. associations. In
EJB3, you explicitly have to query using a JOIN condition to achieve the
same. Personally, I don't care how my association is retrieved, so I
prefer to just say what I want to have retrieved and not how.

Also, it allows you to control what fields are loaded when you detach an
object graph.

>
>Cheers
>Niclas
>
>
>
>



--
________________________________________
__________________
Dipl.-Inf. Jörg von Frantzius | artnology GmbH
| Milastr. 4
Tel +49 (0)30 4435 099 26 | 10437 Berlin
Fax +49 (0)30 4435 099 99 | http://www.artnology.com
_______________________________|________
__________________


Niclas Hedhman

2005-08-08, 5:45 pm

On Monday 08 August 2005 20:48, J=F6rg von Frantzius wrote:
> It's part of the JDO specification, and it allows you to statically
> declare groups of fields on classes and then dynamically combine these
> groups to specify which fields of a class you want to have fetched from
> the DB when using a Query or retrieving via a PersistenceManager directly.


Thanks a lot. Will read up on it. I have over the last 2-3 years delegated =
all=20
JDO works to my right-hand-man, and never heard him mention it (if new in=20
JDO2, it would explain why).


Cheers
Niclas

Craig Russell

2005-08-08, 5:45 pm

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com