jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "(Berry) A.W. van Halderen" <b.vanhalde...@hippo.nl>
Subject Re: Database connections & queries
Date Wed, 29 Aug 2007 12:43:19 GMT
On Tue, Aug 28, 2007 at 06:55:14PM +0300, Jukka Zitting wrote:
> On 8/24/07, Jukka Zitting <jukka.zitting@gmail.com> wrote:
> > On 8/22/07, Martijn Hendriks <martijnh@gx.nl> wrote:
> > > The current implementation of the LazyScoreNodeIterator is such to
> > > ignore all RepositoryExceptions that might be thrown while loading the
> > > nodes in the result set, as required by the javax.jcr.NodeIterator spec.
> > I think the correct behaviour would be for the node iterator to throw
> > an exception (unfortunately I guess only a RuntimeException would work
> > here) instead of ignoring such internal errors.
> 
> A thought just crossed my mind... As mentioned in another thread a few
> days ago, we could make NodeImpl to load the underlying node states
> only on demand as long as we have just the node ID, parent ID, and
> name of the node available. This way we could "delay" the exception to
> a method like getProperty() that is allowed to throw appropriate
> exceptions.
> 
> Besides, such a solution would most likely give a nice speedup to
> clients that just want to get the names or paths of nodes that match a
> query...

Very good idea, decoupling the actual node contents (properties,children)
from its outer shell (node id, etc) opens up all kind of possiblities.
The NoSuchElement solution is IMO not preferable, as its semantics is
already well defined for iterators and not not match this use.

\Berry
-- 
Berry A.W. van Halderen           b.vanhalderen@hippo.nl / berry@halderen.net
Disclaimer: the above is the author's personal opinion and is not the opinion
or policy of his employer or of the little green men that have been following
him all day.

Mime
View raw message